Hi all.

I have just noticed that exception objects does not handle well Unicode 
arguments.

>>> e = RuntimeError(u'àèìòù')
>>> str(e)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode characters in position 
0-4: ordinal not in range(128)
>>> unicode(e)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode characters in position 
0-4: ordinal not in range(128)


C object struct does not have a tp_unicode slot (maybe it will be added 
in Python 3000?), however I think that the Base Exception class should 
implement the __unicode__ method.

Any problems in doing so?
I have not yet required this feature in the Python tracker.


Thanks  Manlio Perillo
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to