http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11533
Revision: 11533 Author: drtrigon Date: 2013-05-13 20:15:31 +0000 (Mon, 13 May 2013) Log Message: ----------- bug fix; LookupError: unknown encoding: binary this has to be ignored if back_response=True
Modified Paths: -------------- trunk/pywikipedia/pywikibot/comms/http.py
Modified: trunk/pywikipedia/pywikibot/comms/http.py =================================================================== --- trunk/pywikipedia/pywikibot/comms/http.py 2013-05-13 19:35:40 UTC (rev 11532) +++ trunk/pywikipedia/pywikibot/comms/http.py 2013-05-13 20:15:31 UTC (rev 11533) @@ -242,6 +242,11 @@ % (site.protocol(), site.hostname(), uri)) # We use error='replace' in case of bad encoding. text = unicode(text, charset, errors = 'replace') + except LookupError: + if back_response: + pywikibot.exception() + else: + raise
if back_response: return f, text
pywikipedia-svn@lists.wikimedia.org