pathlib and paths with arbitrary bytes
The pathlib
module was added to the standard library in Python 3.4 and is one of the many nice improvements that Python 3 has gained over the past decade. In three weeks, Python 3.5 will be the oldest version of Python that still receives security patches. This means that the presence of pathlib
can soon be taken for granted on all Python installations, and the quest towards replacing os.path
can begin for real.
In this post, I’ll have a look at how pathlib
can be used to handle file paths containing arbitrary bytes, as this is valid on most file systems.