Bugs item #3514907, was opened at 2012-04-04 08:09 Message generated for change (Comment added) made by binbot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3514907...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: alchimista () Assigned to: Nobody/Anonymous (nobody) Summary: Unicode error on print statment
Initial Comment: I'm having an unicode error on print statments, when printing chars like "é", "ê" and similars. It works fine on my lap, and on ts willows, but occours on longruns jobs. The script is a fork of http://code.google.com/p/avbot/source/browse/#svn%2Ftrunk with some minor changes wich has no impact on the print elements. The output for the article [[Política do café com leite]] is:
Unhandled exception in thread started by <function editAnalysis at 0x85b88b4> Traceback (most recent call last): File "/home/alchimista/aleph/avbotanalysis.py", line 681, in editAnalysis [reverted, editData]=mustBeReverted(editData, cleandata, editData['userClass']) File "/home/alchimista/aleph/avbotanalysis.py", line 428, in mustBeReverted return revertAllEditsByUser(editData, userClass, regexplist) #Revert File "/home/alchimista/aleph/avbotanalysis.py", line 250, in revertAllEditsByUser editData=sameOldid(editData) File "/home/alchimista/aleph/avbotanalysis.py", line 113, in sameOldid print 4, editData['pageTitle'], time.time()-t1 UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 3: ordinal not in range(128)
----------------------------------------------------------------------
Comment By: Bináris (binbot)
Date: 2012-04-04 08:32
Message: Instead of print use wikipedia.output. It is strongly recommended ofr long-term compatibility that you change "import wikipedia" to "import wikipedia as pywikibot" and use pywikibot.output for any accented text.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3514907...
pywikipedia-bugs@lists.wikimedia.org