STINNER Victor <victor.stin...@haypocalc.com> added the comment: You change change the display hook with a site.py script (which have to be in sys.path) : --------- import sys
def hook(message): print(ascii(message)) sys.displayhook = hook --------- Example (run python in an empty environment to get ASCII charset): --------- $ env -i PYTHONPATH=$PWD ./python Python 3.1a0 (py3k:69105M, Jan 30 2009, 10:36:27) >>> import sys >>> sys.stdout.encoding 'ANSI_X3.4-1968' >>> "\xe9" '\xe9' >>> print("\xe9") Traceback (most recent call last): (...) UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' (...) --------- _______________________________________ 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