Title: Add `pathlib.Path.from_uri()` classmethod · Issue #107465 · python/cpython · GitHub
Open Graph Title: Add `pathlib.Path.from_uri()` classmethod · Issue #107465 · python/cpython
X Title: Add `pathlib.Path.from_uri()` classmethod · Issue #107465 · python/cpython
Description: Feature or enhancement Add pathlib.Path.from_uri() classmethod that creates a path objects from a 'file' URI, like file:///c:/windows. This method should accept RFC 8089 file: URIs, including variant forms. Pitch The proposed method is t...
Open Graph Description: Feature or enhancement Add pathlib.Path.from_uri() classmethod that creates a path objects from a 'file' URI, like file:///c:/windows. This method should accept RFC 8089 file: URIs, including varia...
X Description: Feature or enhancement Add pathlib.Path.from_uri() classmethod that creates a path objects from a 'file' URI, like file:///c:/windows. This method should accept RFC 8089 file: URIs, includi...
Opengraph URL: https://github.com/python/cpython/issues/107465
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `pathlib.Path.from_uri()` classmethod","articleBody":"# Feature or enhancement\r\n\r\nAdd `pathlib.Path.from_uri()` classmethod that creates a path objects from a 'file' URI, like `file:///c:/windows`. This method should accept [RFC 8089](https://datatracker.ietf.org/doc/html/rfc8089) `file:` URIs, including variant forms.\r\n\r\n# Pitch\r\n\r\nThe proposed method is the counterpart of `pathlib.Path.as_uri()`. As we continue to open up pathlib for subclassing, user subclasses of path classes will begin to appear with their own `as_uri()` methods returning URIs like `s3://`, `ftp://`. These subclasses will likely also support parsing URIs to create paths. However, there is currently no defined interface for doing this in pathlib, and users will be tempted to accept URIs in initialisers, which produces a confusing interface. If pathlib instead defines a `from_uri()` classmethod, there is one clear and obvious method that subclasses may override.\r\n\r\n# Previous discussion\r\n\r\nSee https://discuss.python.org/t/make-pathlib-extensible/3428/136 and subsequent posts\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-107640\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2023-07-30T19:55:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/107465/cpython/issues/107465"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:692250cc-4259-f091-f206-ec7f0e44d0fe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFC4:319547:3247DB8:41D2919:696B8C40 |
| html-safe-nonce | 158c509543b7fc47d921d6d14a0cd66a275d7db95a2fa862528fd5cc4ab5c914 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkM0OjMxOTU0NzozMjQ3REI4OjQxRDI5MTk6Njk2QjhDNDAiLCJ2aXNpdG9yX2lkIjoiNDcxOTM5MTE0NzAwNjA2OTgyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 44135a190cde7683241c1511f4f459a2c10d00b3514910089437b70a28e74d96 |
| hovercard-subject-tag | issue:1828050949 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/107465/issue_layout |
| twitter:image | https://opengraph.githubassets.com/65cf58385de399246ce1b657cd86d515454e7bcea0e257937e5e74bfcf63645b/python/cpython/issues/107465 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/65cf58385de399246ce1b657cd86d515454e7bcea0e257937e5e74bfcf63645b/python/cpython/issues/107465 |
| og:image:alt | Feature or enhancement Add pathlib.Path.from_uri() classmethod that creates a path objects from a 'file' URI, like file:///c:/windows. This method should accept RFC 8089 file: URIs, including varia... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | barneygale |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width