properly deal with python's broken unicode exception handling

This commit is contained in:
Damien Elmes 2012-07-19 15:10:33 +09:00
parent 43c8777c7f
commit ac8f04166c
2 changed files with 2 additions and 2 deletions

View file

@ -201,7 +201,7 @@ class AddonDownloader(QThread):
resp, cont = con.request(
aqt.appShared + "download/%d" % self.code)
except Exception, e:
self.error = unicode(e)
self.error = unicode(e[0], "utf8", "ignore")
return
finally:
remHook("httpRecv", recvEvent)

View file

@ -261,7 +261,7 @@ class SyncThread(QThread):
try:
ret = self.client.sync()
except Exception, e:
err = unicode(e)
err = unicode(e[0], "utf8", "ignore")
if "Unable to find the server" in err:
self.fireEvent("offline")
else: