New submission from Armin Rigo <[email protected]>:

The user can raise an exception with a unicode error message.  But the
interpreter displays it (after a traceback) in an very ascii-oriented way.

The behavior is arguably very bogus on CPython: it doesn't print the unicode
message at all if it's not purely ascii.

The traceback.py module (and so PyPy) are slightly better: they convert and
print the message with `.encode("ascii", "backslashreplace")`.  While this might
be enough for western languages, it is not really useful in languages like
Chinese: you get "Exception: \u1234\u1235\u5212".

We should decide if this is worth improving in traceback.py, and if so, do it. 
(Fwiw CPython seems to believe that keeping the error messages perfectly
unreadable is a good way to push forward for Python 3, so it's unlikely to get
fixed "upstream".)

----------
messages: 6333
nosy: arigo, pypy-issue
priority: bug
status: unread
title: Exception: ..unreadable backslash stuff..

________________________________________
PyPy bug tracker <[email protected]>
<https://bugs.pypy.org/issue1634>
________________________________________
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to