On Thu, Aug 18, 2016, at 11:29, Chris Angelico wrote: > >>>> glob.glob('test*') > > ['test\uab00.txt'] > >>>> glob.glob(b'test*') > > [b'test?.txt'] > > > > The Unicode character in the second call to glob is missing information. > > Apologies if this is just noise, but I'm a little confused by this. > The second call to glob doesn't have any Unicode characters at all, > the way I see it - it's all bytes. Am I completely misunderstanding > this?
The unicode character is in the actual name of the actual file being matched. That the byte string returned by glob fails to represent that character in any encoding is the problem. Glob results don't exist in a vacuum, they're supposed to represent, and be usable to access, files that actually exist on the real filesystem. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/