[issue32456] PYTHONIOENCODING=undefined doesn't work in Python 3

Martin Panter report at bugs.python.org
Tue Jan 2 14:30:14 EST 2018


Martin Panter <vadmium+py at gmail.com> added the comment:

My guess is there is no message because in Python 3, errors are encoded according to PYTHONIOENCODING. Perhaps it works as you expect if you bypass sys.excepthook:

$ PYTHONIOENCODING=undefined python -c 'import sys, os; sys.excepthook = lambda *exc: os.write(2, ascii(exc).encode()); print(u"abc")'
(<class 'UnicodeError'>, UnicodeError('undefined encoding',), <traceback object at 0xb7037b94>)

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32456>
_______________________________________


More information about the Python-bugs-list mailing list