On Feb 9, 2016, at 17:37, Steve Dower <pyt...@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.
* Well, maybe in the future, some linux distros will bite the same bullet OS X
did and mandate that filesystem drivers must expose UTF-8, doing whatever
transcoding or other munging is necessary under the covers, to be valid. But
I'm guessing any such distros will be all-Python-3 long before then, and the
people using Python 2 will also be using old versions or conservative distros.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com