mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 21:03:43 +02:00
Fix unicode bug in error handling
This commit is contained in:
parent
a17df74ed4
commit
f58ee6472a
1 changed files with 8 additions and 1 deletions
|
|
@ -72,7 +72,14 @@ def run(self):
|
|||
if self._aborted:
|
||||
return
|
||||
self.failed = True
|
||||
self._details = unicode(err) + '\n\n' + \
|
||||
try:
|
||||
ex = unicode(err)
|
||||
except:
|
||||
try:
|
||||
ex = str(err).decode(preferred_encoding, 'replace')
|
||||
except:
|
||||
ex = repr(err)
|
||||
self._details = ex + '\n\n' + \
|
||||
traceback.format_exc()
|
||||
self.exception = err
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Reference in a new issue