René's URL Explorer Experiment


Title: Improve file URI ergonomics in `urllib.request` · Issue #125866 · python/cpython · GitHub

Open Graph Title: Improve file URI ergonomics in `urllib.request` · Issue #125866 · python/cpython

X Title: Improve file URI ergonomics in `urllib.request` · Issue #125866 · python/cpython

Description: Feature or enhancement I request that we make pathname2url and url2pathname easier to use: pathname2url() is made to accept an optional include_scheme argument that sticks file: on the front when true url2pathname() is made to strip any ...

Open Graph Description: Feature or enhancement I request that we make pathname2url and url2pathname easier to use: pathname2url() is made to accept an optional include_scheme argument that sticks file: on the front when t...

X Description: Feature or enhancement I request that we make pathname2url and url2pathname easier to use: pathname2url() is made to accept an optional include_scheme argument that sticks file: on the front when t...

Opengraph URL: https://github.com/python/cpython/issues/125866

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve file URI ergonomics in `urllib.request`","articleBody":"# Feature or enhancement\r\n\r\nI request that we make [`pathname2url`](https://docs.python.org/3/library/urllib.request.html#urllib.request.pathname2url) and [`url2pathname`](https://docs.python.org/3/library/urllib.request.html#urllib.request.url2pathname) easier to use:\r\n\r\n- `pathname2url()` is made to accept an optional *include_scheme* argument that sticks `file:` on the front when true\r\n- `url2pathname()` is made to strip any `file:` prefix from its argument.\r\n\r\nI think this would go a long way towards making these functions usable, and allow us to remove the scary \"This does not accept/produce a complete URL\" warnings from the docs.\r\n\r\n\u003c!-- gh-linked-prs -->\r\n### Linked PRs\r\n* gh-125993\r\n* gh-126144\r\n* gh-126145\r\n* gh-127138\r\n* gh-131432\n* gh-132378\n\u003c!-- /gh-linked-prs -->\r\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2024-10-23T03:23:32Z","url":"https://github.com/python/cpython/issues/125866"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bb19d86e-ef1b-7bec-0d82-6b8dc2bc11e6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8946:296654:364D10C:4852929:6B020AE2
html-safe-nonce35087c3831b614270311c3d8b01c48f20256cde2cc42dd4416967a3e03eaf858
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTQ2OjI5NjY1NDozNjREMTBDOjQ4NTI5Mjk6NkIwMjBBRTIiLCJ2aXNpdG9yX2lkIjoiNzcyODM5NDYxODQyMDcyNjQ5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2845bf6a490fd47613190c91a8b3af9441d282e663c172b75c07f66725bce04d
hovercard-subject-tagissue:2607065453
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/125866/issue_layout
twitter:imagehttps://opengraph.githubassets.com/43c795bbdddc533b889ee1340a956b894066c89688a23c84c55b725798d837b9/python/cpython/issues/125866
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/43c795bbdddc533b889ee1340a956b894066c89688a23c84c55b725798d837b9/python/cpython/issues/125866
og:image:altFeature or enhancement I request that we make pathname2url and url2pathname easier to use: pathname2url() is made to accept an optional include_scheme argument that sticks file: on the front when t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebarneygale
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/125866#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F125866
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F125866
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/125866
Reloadhttps://github.com/python/cpython/issues/125866
Reloadhttps://github.com/python/cpython/issues/125866
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/125866
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/125866
Improve file URI ergonomics in urllib.requesthttps://github.com/python/cpython/issues/125866#top
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on Oct 23, 2024https://github.com/python/cpython/issues/125866#issue-2607065453
pathname2urlhttps://docs.python.org/3/library/urllib.request.html#urllib.request.pathname2url
url2pathnamehttps://docs.python.org/3/library/urllib.request.html#urllib.request.url2pathname
GH-125866: Improve tests for pathname2url() and url2pathname() #125993https://github.com/python/cpython/pull/125993
[3.13] GH-125866: Improve tests for pathname2url() and url2pathname() (GH-125993) #126144https://github.com/python/cpython/pull/126144
[3.12] GH-125866: Improve tests for pathname2url() and url2pathname() (GH-125993) #126145https://github.com/python/cpython/pull/126145
GH-125866: Preserve Windows drive letter case in file URIs #127138https://github.com/python/cpython/pull/127138
GH-125866: Deprecate nturl2path module #131432https://github.com/python/cpython/pull/131432
GH-125866: Support complete "file:" URLs in urllib #132378https://github.com/python/cpython/pull/132378
Nexthttps://github.com/python/cpython/issues/125866?timeline_page=1
barneygalehttps://github.com/barneygale
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
on Oct 23, 2024https://github.com/python/cpython/issues/125866#event-14797238793
barneygalehttps://github.com/barneygale
on Oct 25, 2024https://github.com/python/cpython/issues/125866#event-14881762261
pythonGH-125866: Improve tests for `pathname2url()` and `url2pathname()`https://github.com/barneygale/cpython/commit/593b23b52f2a612b95786d4c559cf956b4d5fb53
pythonGH-125866https://github.com/python/cpython/issues/125866
593b23bhttps://github.com/barneygale/cpython/commit/593b23b52f2a612b95786d4c559cf956b4d5fb53
Merge branch 'main' into pythongh-125866-move-testshttps://github.com/barneygale/cpython/commit/75c2944622e1769ed2cc5565260168f5c0f0979c
pythongh-125866https://github.com/python/cpython/issues/125866
75c2944https://github.com/barneygale/cpython/commit/75c2944622e1769ed2cc5565260168f5c0f0979c
Merge branch 'main' into pythongh-125866-move-testshttps://github.com/barneygale/cpython/commit/f455c0deaf265f501aa7eaf776dbbd20be5fff08
pythongh-125866https://github.com/python/cpython/issues/125866
f455c0dhttps://github.com/barneygale/cpython/commit/f455c0deaf265f501aa7eaf776dbbd20be5fff08
GH-125866: Improve tests for `pathname2url()` and `url2pathname()` (#…https://github.com/python/cpython/commit/6742f14dfd3fa8ba8a245efa21a4f723160d93d4
GH-125866https://github.com/python/cpython/issues/125866
#…https://github.com/python/cpython/pull/125993
6742f14https://github.com/python/cpython/commit/6742f14dfd3fa8ba8a245efa21a4f723160d93d4
miss-islingtonhttps://github.com/miss-islington
on Oct 29, 2024https://github.com/python/cpython/issues/125866#event-14991118757
pythonGH-125866: Improve tests for `pathname2url()` and `url2pathname…https://github.com/miss-islington/cpython/commit/64c32bd4f621aa2872123c5bd6dd6f70721c29e3
pythonGH-125866https://github.com/python/cpython/issues/125866
64c32bdhttps://github.com/miss-islington/cpython/commit/64c32bd4f621aa2872123c5bd6dd6f70721c29e3
pythonGH-125866: Improve tests for `pathname2url()` and `url2pathname…https://github.com/miss-islington/cpython/commit/ea8fcb800ff4749ab8cfe7ea19f3beef29408ea0
pythonGH-125866https://github.com/python/cpython/issues/125866
ea8fcb8https://github.com/miss-islington/cpython/commit/ea8fcb800ff4749ab8cfe7ea19f3beef29408ea0
barneygalehttps://github.com/barneygale
on Oct 29, 2024https://github.com/python/cpython/issues/125866#event-14991300768
[3.12] GH-125866: Improve tests for `pathname2url()` and `url2pathnam…https://github.com/python/cpython/commit/b267b6241b8ac9eb6ceb4c65aaf4341d7e54510e
GH-125866https://github.com/python/cpython/issues/125866
b267b62https://github.com/python/cpython/commit/b267b6241b8ac9eb6ceb4c65aaf4341d7e54510e
[3.13] GH-125866: Improve tests for `pathname2url()` and `url2pathnam…https://github.com/python/cpython/commit/35108c1871f41b9090cca231d59e1daded58d488
GH-125866https://github.com/python/cpython/issues/125866
35108c1https://github.com/python/cpython/commit/35108c1871f41b9090cca231d59e1daded58d488
pythonGH-125866: RFC8089 file URIs in `urllib.request`https://github.com/barneygale/cpython/commit/fb92f4208df1dc2f7bf3d1a9a11f7057f5e54e74
pythonGH-125866https://github.com/python/cpython/issues/125866
fb92f42https://github.com/barneygale/cpython/commit/fb92f4208df1dc2f7bf3d1a9a11f7057f5e54e74
picnixzhttps://github.com/picnixz
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on Oct 30, 2024https://github.com/python/cpython/issues/125866#event-15010802222
barneygalehttps://github.com/barneygale
on Oct 30, 2024https://github.com/python/cpython/issues/125866#event-15020555515
Merge branch 'main' into pythongh-125866https://github.com/barneygale/cpython/commit/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29
pythongh-125866https://github.com/python/cpython/issues/125866
5c5a0b5https://github.com/barneygale/cpython/commit/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29
barneygalehttps://github.com/barneygale
on Nov 19, 2024https://github.com/python/cpython/issues/125866#event-15356256037
Revise again with pythonGH-125866 in mind (sorry)https://github.com/barneygale/cpython/commit/27b11274e417e2979ed1e64a8c824ab409f49da8
pythonGH-125866https://github.com/python/cpython/issues/125866
27b1127https://github.com/barneygale/cpython/commit/27b11274e417e2979ed1e64a8c824ab409f49da8
pythonGH-125866: Preserve Windows drive letter case in file URIshttps://github.com/barneygale/cpython/commit/770bb0595cd925c26f572914236dead2ee121a37
pythonGH-125866https://github.com/python/cpython/issues/125866
770bb05https://github.com/barneygale/cpython/commit/770bb0595cd925c26f572914236dead2ee121a37
GH-125866: Preserve Windows drive letter case in file URIs (#127138)https://github.com/python/cpython/commit/cc813e10ff190af38b8429d0d49fb9249493d504
GH-125866https://github.com/python/cpython/issues/125866
#127138https://github.com/python/cpython/pull/127138
cc813e1https://github.com/python/cpython/commit/cc813e10ff190af38b8429d0d49fb9249493d504
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on Nov 25, 2024https://github.com/python/cpython/issues/125866#issuecomment-2498945306
@serhiy-storchakahttps://github.com/serhiy-storchaka
pathname2urlhttps://docs.python.org/3/library/urllib.request.html#urllib.request.pathname2url
url2pathnamehttps://docs.python.org/3/library/urllib.request.html#urllib.request.url2pathname
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Dec 2, 2024https://github.com/python/cpython/issues/125866#issuecomment-2512158585
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on Dec 3, 2024https://github.com/python/cpython/issues/125866#issuecomment-2515368971
https://discuss.python.org/t/file-uris-in-python/15600https://discuss.python.org/t/file-uris-in-python/15600
Add os.path.fileuri() function #88578https://github.com/python/cpython/issues/88578
#123599https://github.com/python/cpython/issues/123599
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on Dec 3, 2024https://github.com/python/cpython/issues/125866#issuecomment-2515422755
picnixzhttps://github.com/picnixz
on Dec 8, 2024https://github.com/python/cpython/issues/125866#event-15572736792
pythonGH-125866: Improve tests for `pathname2url()` and `url2pathname…https://github.com/picnixz/cpython/commit/d2f44de54c79e220ba1c6634284bd6d3f5573e6e
pythonGH-125866https://github.com/python/cpython/issues/125866
d2f44dehttps://github.com/picnixz/cpython/commit/d2f44de54c79e220ba1c6634284bd6d3f5573e6e
ebonnalhttps://github.com/ebonnal
on Jan 12, 2025https://github.com/python/cpython/issues/125866#event-15894559137
pythonGH-125866: Improve tests for `pathname2url()` and `url2pathname…https://github.com/ebonnal/cpython/commit/861925b482dfcd7c4de1b2b306984704561ce6c2
pythonGH-125866https://github.com/python/cpython/issues/125866
861925bhttps://github.com/ebonnal/cpython/commit/861925b482dfcd7c4de1b2b306984704561ce6c2
pythonGH-125866: Preserve Windows drive letter case in file URIs (pyt…https://github.com/ebonnal/cpython/commit/c83f8e96424b787c47e9602943f73538a0129bcd
pythonGH-125866https://github.com/python/cpython/issues/125866
pyt…https://github.com/python/cpython/pull/127138
c83f8e9https://github.com/ebonnal/cpython/commit/c83f8e96424b787c47e9602943f73538a0129bcd
barneygalehttps://github.com/barneygale
on Mar 18, 2025https://github.com/python/cpython/issues/125866#event-16851103448
pythonGH-125866: Add tests for `nturl2path` modulehttps://github.com/barneygale/cpython/commit/033baf5954a86b553472a20c2e3e7d9309241da7
pythonGH-125866https://github.com/python/cpython/issues/125866
033baf5https://github.com/barneygale/cpython/commit/033baf5954a86b553472a20c2e3e7d9309241da7
Merge branch 'main' into pythongh-125866-nturl2path-testshttps://github.com/barneygale/cpython/commit/85a84fc5c91ebbb56c4e7aaaae8f3837d21b15cb
pythongh-125866https://github.com/python/cpython/issues/125866
85a84fchttps://github.com/barneygale/cpython/commit/85a84fc5c91ebbb56c4e7aaaae8f3837d21b15cb
GH-125866: Deprecate `nturl2path` module (#131432)https://github.com/python/cpython/commit/8abfaba5a67a99c446f0c13253ee0ce97bf6fa5c
GH-125866https://github.com/python/cpython/issues/125866
#131432https://github.com/python/cpython/pull/131432
8abfabahttps://github.com/python/cpython/commit/8abfaba5a67a99c446f0c13253ee0ce97bf6fa5c
barneygalehttps://github.com/barneygale
on Apr 10, 2025https://github.com/python/cpython/issues/125866#event-17213444734
pythonGH-125866: Support complete "file:" URLs in urllibhttps://github.com/barneygale/cpython/commit/f70b2c1eec273f0227b3513d4313b0c696eb3063
pythonGH-125866https://github.com/python/cpython/issues/125866
f70b2c1https://github.com/barneygale/cpython/commit/f70b2c1eec273f0227b3513d4313b0c696eb3063
pythonGH-125866: Support complete "file:" URLs in urllibhttps://github.com/barneygale/cpython/commit/8c9fe623ffbfa9929887067d0064a567e91dec12
pythonGH-125866https://github.com/python/cpython/issues/125866
8c9fe62https://github.com/barneygale/cpython/commit/8c9fe623ffbfa9929887067d0064a567e91dec12
Merge branch 'main' into pythongh-125866-againhttps://github.com/barneygale/cpython/commit/db2876d3541d1031f40bb23e3e08c4b115c88e7b
pythongh-125866https://github.com/python/cpython/issues/125866
db2876dhttps://github.com/barneygale/cpython/commit/db2876d3541d1031f40bb23e3e08c4b115c88e7b
GH-125866: Support complete "file:" URLs in urllib (#132378)https://github.com/python/cpython/commit/ccad61e35d240972d14f993507566706fbf419f1
GH-125866https://github.com/python/cpython/issues/125866
#132378https://github.com/python/cpython/pull/132378
ccad61ehttps://github.com/python/cpython/commit/ccad61e35d240972d14f993507566706fbf419f1
barneygalehttps://github.com/barneygale
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 14, 2025https://github.com/python/cpython/issues/125866#event-17240251831
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/125866
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/125866
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.