https://bugzilla.wikimedia.org/show_bug.cgi?id=55249
Web browser: --- Bug ID: 55249 Summary: Unicode error when handling non-ASCII network errors Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1280/ Reported by: tgr_ Created on: 2011-01-09 09:33:39 Subject: Unicode error when handling non-ASCII network errors Original description: The error handler for Site.postData in wikipedia.py line 5248 (in r8821) casts an exception to a string:
except Exception, e: output(u'%s' %e)
This will fail with a UnicodeDecodeError if the exception message contains non-ASCII characters (which is often the case for network error messages on non-English Windows).
Pywikipedia [http] trunk/pywikipedia (r8821, 2011/01/06, 22:01:33) Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] config-settings: use_api = True use_api_login = True unicode test: triggers problem #3081100
https://bugzilla.wikimedia.org/show_bug.cgi?id=55249
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Can you reproduce the problem?
If so, please change output(u"%s" % e) to output(u"%r"% e) and add a comment with the output you get. Additionally, please tell us what code page you are using (run 'chcp' in a dos box) and the language of your windows version.
Thanks.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55249
--- Comment #2 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Hungarian Windows, codepage 852
%r gives
URLError(error(10054, 'A l\xe9tez\xf5 kapcsolatot a t\xe1voli \xe1llom\xe1s k\xe9nyszer\xedtetten bez\xe1rta'),)
https://bugzilla.wikimedia.org/show_bug.cgi?id=55249
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/bugs/1280
https://bugzilla.wikimedia.org/show_bug.cgi?id=55249
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com Version|unspecified |compat (1.0)
pywikipedia-bugs@lists.wikimedia.org