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

2018-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The "undefined" encoding exists. -- ___ Python tracker ___

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

2018-01-03 Thread STINNER Victor
STINNER Victor added the comment: Can't we check if the encoding exists using codecs.lookup() before using it to emit a better error message? Look at initfsencoding() in the C code which implements such check. -- ___

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

2018-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for solving this puzzle Martin. The question is whether we need to do something for improving error reporting in this case or just close this issue with a resolution "not a bug" or "won't fix". --

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

2018-01-02 Thread Martin Panter
Martin Panter 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 =

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

2017-12-30 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : 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