Revision: 3954 Author: wikipedian Date: 2007-08-02 16:27:50 +0000 (Thu, 02 Aug 2007)
Log Message: ----------- encoding bug workaround
Modified Paths: -------------- trunk/pywikipedia/weblinkchecker.py
Modified: trunk/pywikipedia/weblinkchecker.py =================================================================== --- trunk/pywikipedia/weblinkchecker.py 2007-08-02 15:18:17 UTC (rev 3953) +++ trunk/pywikipedia/weblinkchecker.py 2007-08-02 16:27:50 UTC (rev 3954) @@ -320,7 +320,7 @@ # TODO: decode arg[1]. On Linux, it's encoded in UTF-8. # How is it encoded in Windows? Or can we somehow just # get the English message? - return False, u'Socket Error: %s' % arg[1] + return False, u'Socket Error: %s' % repr(arg[1]) #except UnicodeEncodeError, arg: # return False, u'Non-ASCII Characters in URL: %s' % arg if wasRedirected: @@ -357,7 +357,7 @@ try: conn.request('GET', '%s%s' % (self.path, self.query), None, self.header) except socket.error, arg: - return False, u'Socket Error: %s' % arg[1] + return False, u'Socket Error: %s' % repr(arg[1]) #except UnicodeEncodeError, arg: # return False, u'Non-ASCII Characters in URL: %s' % arg try:
pywikipedia-l@lists.wikimedia.org