[Python-Dev] Windows: Remove support of bytes filenames in theos module? (original) (raw)

Andrew Barnert abarnert at yahoo.com
Tue Feb 9 21:01:21 EST 2016


On Feb 9, 2016, at 17:37, Steve Dower <python at stevedower.id.au> wrote:

Could we perhaps redefine bytes paths on Windows as utf8 and use Unicode everywhere internally?

When you receive bytes from argv, stdin, a text file, a GUI, a named pipe, etc., and then use them as a path, Python treating them as UTF-8 would break everything.

Plus, the problem only exists in Python 2, and Python is not going to fix Unicode support in Python 2, both because it's too late for such a major change in Python 2, and because it's probably impossible* (which is why we have Python 3 in the first place).

I really don't like the idea of not being able to use bytes in cross platform code. Unless it's become feasible to use Unicode for lossless filenames on Linux - last I heard it wasn't.

It is, and has been for years. Surrogate escaping solved the linux problem. That doesn't help for Python 2, but again, it's too late for Python 2.



More information about the Python-Dev mailing list