Skip to content

GH-107465: Add pathlib.Path.from_uri() classmethod.#107640

Merged
barneygale merged 13 commits intopython:mainfrom
barneygale:gh-107465-pathlib-from-uri
Oct 1, 2023
Merged

GH-107465: Add pathlib.Path.from_uri() classmethod.#107640
barneygale merged 13 commits intopython:mainfrom
barneygale:gh-107465-pathlib-from-uri

Conversation

@barneygale
Copy link
Contributor

@barneygale barneygale commented Aug 4, 2023

This method supports file URIs (including variants) as described in RFC 8089, such as URIs generated by pathlib.Path.as_uri() and urllib.request.pathname2url().

The method is added to Path rather than PurePath because it uses os.fsdecode(), and so its results vary from system to system. I intend to deprecate PurePath.as_uri() and move it to Path for the same reason.


📚 Documentation preview 📚: https://cpython-previews--107640.org.readthedocs.build/

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants