New submission from Serhiy Storchaka <[email protected]>:
In Python 2.7 setting PYTHONIOENCODING=undefined mostly works as expected.
$ PYTHONIOENCODING=undefined python -c 'print(123)'
123
$ PYTHONIOENCODING=undefined python -c 'print("abc")'
abc
$ PYTHONIOENCODING=undefined python -c 'print(u"abc")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/encodings/undefined.py", line 19, in encode
raise UnicodeError("undefined encoding")
UnicodeError: undefined encoding
Most tests (except test_doctest and test_gdb) are passed with
PYTHONIOENCODING=undefined.
But in Python 3 setting PYTHONIOENCODING=undefined seems just silently
terminates the interpreter (exited with code 1).
----------
components: IO, Interpreter Core, Unicode
messages: 309237
nosy: benjamin.peterson, ezio.melotti, lemburg, ncoghlan, serhiy.storchaka,
vstinner
priority: normal
severity: normal
status: open
title: PYTHONIOENCODING=undefined doesn't work in Python 3
type: behavior
versions: Python 3.6, Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32456>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com