[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

STINNER Victor report at bugs.python.org
Mon Apr 28 01:33:57 CEST 2014


STINNER Victor added the comment:

> We should not overcomplicate this. I suggest that we simply use utf-8 under the C locale.

Do you mean utf8/strict or utf8/surrogateescape?

utf8/strict doesn't work (os.listdir raises an unicode error) if your
system is configured to use latin1 (ex: filenames are stored in this
encoding), but unfortunately your program is running in an empty
environment (so will use the POSIX locale).

----------

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


More information about the Python-bugs-list mailing list