mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
properly deal with python's broken unicode exception handling
This commit is contained in:
parent
43c8777c7f
commit
ac8f04166c
2 changed files with 2 additions and 2 deletions
|
@ -201,7 +201,7 @@ class AddonDownloader(QThread):
|
||||||
resp, cont = con.request(
|
resp, cont = con.request(
|
||||||
aqt.appShared + "download/%d" % self.code)
|
aqt.appShared + "download/%d" % self.code)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.error = unicode(e)
|
self.error = unicode(e[0], "utf8", "ignore")
|
||||||
return
|
return
|
||||||
finally:
|
finally:
|
||||||
remHook("httpRecv", recvEvent)
|
remHook("httpRecv", recvEvent)
|
||||||
|
|
|
@ -261,7 +261,7 @@ class SyncThread(QThread):
|
||||||
try:
|
try:
|
||||||
ret = self.client.sync()
|
ret = self.client.sync()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
err = unicode(e)
|
err = unicode(e[0], "utf8", "ignore")
|
||||||
if "Unable to find the server" in err:
|
if "Unable to find the server" in err:
|
||||||
self.fireEvent("offline")
|
self.fireEvent("offline")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue