mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
can't specify coding in unicode(except); convert traceback instead
This commit is contained in:
parent
4c398fc728
commit
2f6db69113
2 changed files with 4 additions and 2 deletions
|
@ -201,7 +201,7 @@ class AddonDownloader(QThread):
|
|||
resp, cont = con.request(
|
||||
aqt.appShared + "download/%d" % self.code)
|
||||
except Exception, e:
|
||||
self.error = unicode(e, "utf8", "replace")
|
||||
self.error = unicode(e)
|
||||
return
|
||||
finally:
|
||||
remHook("httpRecv", recvEvent)
|
||||
|
|
|
@ -122,7 +122,7 @@ Please upgrade to the latest version of Anki.""")
|
|||
elif "502" in err or "503" in err or "504" in err:
|
||||
return _("""\
|
||||
AnkiWeb is too busy at the moment. Please try again in a few minutes.""")
|
||||
return unicode(err, "utf8", "replace")
|
||||
return err
|
||||
|
||||
def _getUserPass(self):
|
||||
d = QDialog(self.mw)
|
||||
|
@ -234,6 +234,8 @@ class SyncThread(QThread):
|
|||
self._sync()
|
||||
except:
|
||||
err = traceback.format_exc()
|
||||
if not isinstance(err, unicode):
|
||||
err = unicode(err, "utf8", "replace")
|
||||
self.fireEvent("error", err)
|
||||
finally:
|
||||
# don't bump mod time unless we explicitly save
|
||||
|
|
Loading…
Reference in a new issue