[Python-ideas] Working with Path objects: p-strings?

Random832 random832 at fastmail.com
Tue Mar 29 09:36:52 EDT 2016


On Tue, Mar 29, 2016, at 07:21, Steven D'Aprano wrote:
> Unless I'm missing something, pathlib doesn't support bytes filenames. 
> So the question doesn't come up. Any path you can use with pathlib is a 
> valid Python string, because you can only create paths using Python 
> strings.
> 
> So if I have a Linux file b'\xD8\x01', I can't create a path object to 
> work with it.

Any reason you can't use surrogateescape and "\uDCD8\x01"?


More information about the Python-ideas mailing list