[issue2517] Error when printing an exception containing a Unicode string

Christoph Burgmer report at bugs.python.org
Mon Mar 31 01:13:52 CEST 2008


New submission from Christoph Burgmer <cburgmer at ira.uka.de>:

Python seems to have problems when an exception is thrown that 
contains non-ASCII text as a message and is converted to a string.

>>> try:
...     raise Exception(u'Error when printing ü')
... except Exception, e:
...     print e
...
Traceback (most recent call last):
  File "", line 4, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in 
position 20:
ordinal not in range(128)

See 
http://www.stud.uni-karlsruhe.de/~uyhc/de/content/python-and-exceptions-containing-unicode-messages

----------
components: Unicode
messages: 64770
nosy: christoph
severity: normal
status: open
title: Error when printing an exception containing a Unicode string
type: behavior
versions: Python 2.4, Python 2.5

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2517>
__________________________________


More information about the Python-bugs-list mailing list