Nick Coghlan added the comment:

The POSIX locale tells Python 3 to use ASCII for all operating system 
interfaces, including the standard streams. This is an antiquated behaviour in 
the POSIX spec that Python 3 doesn't currently work around.

Issue 19977 is a proposal to work around this limitation by default.

As an immediate workaround, it's possible to either set PYTHONIOENCODING 
explicitly so Python ignores the incorrect encoding claims from the OS, or else 
to do your own encoding and write directly to the sys.stdout.buffer binary 
interface.

Python 3.4 also allows setting *just* the default error handler for the 
streams, while still getting the encoding from the OS.

----------
resolution:  -> duplicate
status: open -> closed
superseder:  -> Use "surrogateescape" error handler for sys.stdin and 
sys.stdout on UNIX for the C locale

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20329>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to