On Sat, Mar 7, 2020, at 19:31, Cameron Simpson wrote: > >I *think* I understand the issues. And I can see that some software would > >need to work with filenames as arbitrary bytes. But that doesn't mean that > >you can do much with them that way. > > Given that the entire UNIX filename API is bytes, I think this isn't > very true.
Most real-world UNIX systems only support ASCII-compatible encodings. There's no reason not to solve the problem on such systems by using os.fsdecode(). On those few that do not (of which I don't know if any support *both* ASCII and non-ASCII-compatible encodings in locales - from what I can find, those that don't use ASCII-compatible encodings tend to exclusively use EBCDIC ones) I don't know how they handle these cases, or if python even supports any of them at all, but it seems likely that b'/' will not be the same byte as the path separator. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/MKOPNOW6S4PLTDYHQDD4RDDWO5GQXZ5K/ Code of Conduct: http://python.org/psf/codeofconduct/