[issue10419] distutils command build_scripts fails with UnicodeDecodeError

STINNER Victor report at bugs.python.org
Mon May 2 15:53:21 CEST 2011


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

> copy_script-2.patch uses os.fsencode(), which doesn't exist in Python 3.1.

Correct, with Python 3.1, you can use filename.encode(sys.getfilesystemencoding(), 'surrogateescape'). But you must use os.fsencode() with Python >= 3.2 because on Windows, you cannot use surrogateescape with MBCS (you should use the strict error handler).

----------

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


More information about the Python-bugs-list mailing list