[Python-Dev] file system path protocol PEP (original) (raw)
Ethan Furman ethan at stoneleaf.us
Thu May 12 15:30:45 EDT 2016
- Previous message (by thread): [Python-Dev] file system path protocol PEP
- Next message (by thread): [Python-Dev] file system path protocol PEP
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 05/12/2016 10:22 AM, Sjoerd Job Postmus wrote:
However, if it were to reject bytes, that would mean that when libraries start to use pathlib, it would suddenly become harder for people that actually need bytes-support to use pathlib.
pathlib is not about bytes support. While bytes are necessary in this digital world we live in, most things that look like text should be text, and that includes most paths.
Now, the claim 'if you need bytes, you should not be using pathlib` is a reasonable one. But what if I need bytes and a specific library (say, image handling, or a web framework, or ...). It's not up to me if that library uses pathlib or plain old os.path.join.
If you need bytes support for your paths, there's at least one [1] that has that support.
--
Ethan
[1] Yeah, it's mine [2]. ;) I haven't checked if the other third-party libs do or not.
[2] https://pypi.python.org/pypi/antipathy </shameless plug>
- Previous message (by thread): [Python-Dev] file system path protocol PEP
- Next message (by thread): [Python-Dev] file system path protocol PEP
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]