[pypy-issue] [issue1634] Exception: ..unreadable backslash stuff..

Armin Rigo tracker at bugs.pypy.org
Fri Nov 15 18:16:09 CET 2013

New submission from Armin Rigo <armin.rigo at gmail.com>:

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 <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list