mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22: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(
|
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, "utf8", "replace")
|
self.error = unicode(e)
|
||||||
return
|
return
|
||||||
finally:
|
finally:
|
||||||
remHook("httpRecv", recvEvent)
|
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:
|
elif "502" in err or "503" in err or "504" in err:
|
||||||
return _("""\
|
return _("""\
|
||||||
AnkiWeb is too busy at the moment. Please try again in a few minutes.""")
|
AnkiWeb is too busy at the moment. Please try again in a few minutes.""")
|
||||||
return unicode(err, "utf8", "replace")
|
return err
|
||||||
|
|
||||||
def _getUserPass(self):
|
def _getUserPass(self):
|
||||||
d = QDialog(self.mw)
|
d = QDialog(self.mw)
|
||||||
|
@ -234,6 +234,8 @@ class SyncThread(QThread):
|
||||||
self._sync()
|
self._sync()
|
||||||
except:
|
except:
|
||||||
err = traceback.format_exc()
|
err = traceback.format_exc()
|
||||||
|
if not isinstance(err, unicode):
|
||||||
|
err = unicode(err, "utf8", "replace")
|
||||||
self.fireEvent("error", err)
|
self.fireEvent("error", err)
|
||||||
finally:
|
finally:
|
||||||
# don't bump mod time unless we explicitly save
|
# don't bump mod time unless we explicitly save
|
||||||
|
|
Loading…
Reference in a new issue