STINNER Victor added the comment:

2013/11/7 Serhiy Storchaka <>:
>> On Windows, these changes should allow to pass an unencodable filename on 
>> the command line (ex: japanese script name on an english setup).
> Doesn't the surrogateescape error handler solve this issue?

surrogateescape is very specific to UNIX, or more generally systems
using bytes filenames. Windows native type for filename is Unicode. To
support any Unicode filename on Windows, you must never encode a

surrogateescape avoids decoding errors, here is the problem is an
encoding error.

For example, "abé" cannot be encoded to ASCII. "abé".encode("ascii",
"surrogateescape") doesn't help here.


Python tracker <>
Python-bugs-list mailing list

Reply via email to