Simple unicode-safe version of str(exception)?

Torsten Bronger bronger at physik.rwth-aachen.de
Tue Apr 29 22:34:26 CEST 2008


Hallöchen!

Russell E. Owen writes:

> Torsten Bronger <bronger at physik.rwth-aachen.de> wrote:
>
>> Russell E. Owen writes:
>> 
>>> [...]
>>>
>>> So...to repeat the original question, is there any simpler
>>> unicode-safe replacement for str(exception)?
>> 
>> Please show us the tracebacks you get becuae unicode(s) must
>> fail, too, if there are non-ASCII characters involved.
>
> Why?
>
> [...]
>
>>>> ",".join([unicode(s) for s in e.args])
> u'\xb0'

I thought you wanted to have a string.  But this is again a unicode.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: bronger at jabber.org
               (See http://ime.webhop.org for further contact info.)



More information about the Python-list mailing list