Last modified: 2014-08-29 18:51:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57203, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55203 - Unicode error on print statement
Unicode error on print statement
Status: RESOLVED WONTFIX
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:43 UTC by Kunal Mehta (Legoktm)
Modified: 2014-08-29 18:51 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:43:17 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1430/
Reported by: Anonymous user
Created on: 2012-04-04 15:09:48
Subject: Unicode error on print statment
Original description:
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 1 Kunal Mehta (Legoktm) 2013-10-05 04:43:19 UTC
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.
Comment 2 Ricordisamoa 2014-03-16 00:41:40 UTC
WORKSFORME?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links