[issue20329] zipfile.extractall fails in Posix shell with utf-8 filename

Nick Coghlan report at bugs.python.org
Wed Jan 22 23:36:58 CET 2014


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 <report at bugs.python.org>
<http://bugs.python.org/issue20329>
_______________________________________


More information about the Python-bugs-list mailing list