STINNER Victor <[email protected]> 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 <[email protected]> <http://bugs.python.org/issue6011> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
