◐ Shell
clean mode source ↗

Message 134972 - Python tracker

> 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).