Comment 1 for bug 929794

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

It looks like we need something like this:

try:
   text = unicode(err)
except TypeError:
   text = str(err)
text = str.encode("UTF-8", "replace")

As calling unicode on exception instanced does not seem to convert them to a string representation by calling __unicode__ (sadly).