[issue6501] Fatal error on startup with invalid PYTHONIOENCODING

STINNER Victor report at bugs.python.org
Mon May 2 01:46:18 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> Fatal Python error: Py_Initialize: can't initialize sys standard streams
> LookupError: unknown encoding: cp0

That's a bug in os.device_encoding(): os.device_encoding(sys.stdout.fileno()) should return None if the application has no console (if sys.stdout is not a Windows console stream).

Attached device_encoding.patch should fix this issue. (I didn't test the patch yet.)

----------
Added file: http://bugs.python.org/file21849/device_encoding.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6501>
_______________________________________


More information about the Python-bugs-list mailing list