[New-bugs-announce] [issue32456] PYTHONIOENCODING=undefined doesn't work in Python 3

Serhiy Storchaka report at bugs.python.org
Sat Dec 30 11:26:14 EST 2017

New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

In Python 2.7 setting PYTHONIOENCODING=undefined mostly works as expected.

$ PYTHONIOENCODING=undefined python -c 'print(123)'
$ PYTHONIOENCODING=undefined python -c 'print("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 <report at bugs.python.org>

More information about the New-bugs-announce mailing list