Fix unicode bug in error handling

This commit is contained in:
Kovid Goyal 2010-07-22 11:54:21 -06:00
parent a17df74ed4
commit f58ee6472a

View File

@ -72,7 +72,14 @@ class DeviceJob(BaseJob): # {{{
if self._aborted: if self._aborted:
return return
self.failed = True 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() traceback.format_exc()
self.exception = err self.exception = err
finally: finally: