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).
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).