Last modified: 2014-09-17 11:09:17 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 T57249, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55249 - Unicode error when handling non-ASCII network errors
Unicode error when handling non-ASCII network errors
Status: NEW
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
compat-(1.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:51 UTC by Kunal Mehta (Legoktm)
Modified: 2014-09-17 11:09 UTC (History)
1 user (show)

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


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:51:18 UTC
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
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:51:20 UTC
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.
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:51:22 UTC
Hungarian Windows, codepage 852

%r gives

URLError\(error\(10054, 'A l\xe9tez\xf5 kapcsolatot a t\xe1voli \xe1llom\xe1s k\xe9nyszer\xedtetten bez\xe1rta'\),\)

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


Navigation
Links