Python 3.0 crashes displaying Unicode at interactive prompt
"Martin v. Löwis"
martin at v.loewis.de
Mon Dec 15 00:42:05 CET 2008
> It's unfortunate that the default behaviour isn't
> optimal at the interactive prompt for some configurations, though.
As I said, it's a trade-off. The alternative, if it was the default,
wouldn't be optimal at the interactive prompt for some other
In particular, users of non-latin scripts have been complaining that
they can't read their strings - hence the change, which now actually
allows these users to read the text that is stored in the strings.
The question really is why John Machin has a string that contains
'\u9876' (which is a Chinese character), yet his terminal is incapable
of displaying that character. More likely, people will typically
encounter only characters in their data that their terminals are
also capable of displaying (or else the terminal would be pretty
In the long run, it might be useful to have an error handler on
sys.stdout in interactive mode, which escapes characters that
cannot be encoded (perhaps in a different color, if the terminal
supports colors, to make it clear that it is an escape sequence)
More information about the Python-list