[issue6011] python doesn't build if prefix contains non-ascii characters

STINNER Victor report at bugs.python.org
Sat Dec 25 23:56:52 CET 2010


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

Le samedi 25 décembre 2010 à 22:35 +0000, Éric Araujo a écrit :
> Victor: Your patch uses os.fsencode, so porting to distutils2 won’t be
> easy.

In Python 3.1, you can replace name=os.fsencode(name) by
name=name.encode(sys.getfilesystemencoding(), 'surrogateescape'). The
mbcs codec doesn't support surrogateescape. In Python 3.2 it does now
raise an error (and so os.fsencode() uses strict error handler if the
encoding is mbcs), whereas Python 3.1 just ignores the error handler (it
uses 'ignore' to encode).

In Python 2, self.executable is already a byte string (you don't need
os.fsencode()).

----------

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


More information about the Python-bugs-list mailing list