STINNER Victor <victor.stin...@haypocalc.com> added the comment:

To be clear, this issue only affects the interpreter.

> 2) use ascii(), but it adds extra "" around the output

It doesn't ass extra "" if you replace repr() by ascii() in the 
interpreter code (sys.displayhook)?

> The best solution is probably to change the default error-handler 
> of the Python3 interactive interpreter to 'backslashreplace' 
> in order to avoid this behavior, (...)

Hum, it implies that sys.stdout has a different behaviour in the 
interpreter and when running a script. We can expect many bugs ports 
from newbies "the example works in the terminal/IDLE, but not in my 
script, HELP!". So I prefer ascii().

----------
nosy: +haypo

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5110>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to