René's URL Explorer Experiment


Title: GH-125866: RFC8089 file URIs in `urllib.request` by barneygale · Pull Request #126148 · python/cpython · GitHub

Open Graph Title: GH-125866: RFC8089 file URIs in `urllib.request` by barneygale · Pull Request #126148 · python/cpython

X Title: GH-125866: RFC8089 file URIs in `urllib.request` by barneygale · Pull Request #126148 · python/cpython

Description: Adjust urllib.request.pathname2url() and url2pathname() to generate and accept file URIs as described in RFC8089. pathname2url() gains a new include_scheme argument, which defaults to false. When set to true, the returned URL includes a file: prefix. url2pathname() now automatically removes a file: prefix if present. On Windows, pathname2url() now generates URIs that begin with two slashes rather than four when given a UNC path. On other platforms, pathname2url() now generates URIs that begin with three slashes rather than one when given an absolute path. url2pathname() now performs the opposite transformation, so file:///etc/hosts becomes /etc/hosts. Furthermore, url2pathname() now ignores local hosts (like "localhost" or any alias) and raises URLError for non-local hosts. pathname2url() examples (star marks differences): previously now pathname2url('foo/bar') foo/bar foo/bar pathname2url('/foo/bar') /foo/bar ///foo/bar * pathname2url('//foo/bar') (POSIX) //foo/bar ////foo/bar * pathname2url('//foo/bar') (Windows) ////foo/bar //foo/bar * url2pathname() examples (star marks differences): previously now url2pathname('foo/bar') foo/bar foo/bar url2pathname('/foo/bar') /foo/bar /foo/bar url2pathname('//foo/bar') (POSIX) //foo/bar raise URLError * url2pathname('//foo/bar') (Windows) //foo/bar //foo/bar url2pathname('///foo/bar') ///foo/bar /foo/bar * url2pathname('////foo/bar') (POSIX) ////foo/bar //foo/bar * url2pathname('////foo/bar') (Windows) //foo/bar //foo/bar url2pathname('/////foo/bar') (Windows) ///foo/bar //foo/bar * Issue: gh-125866 📚 Documentation preview 📚: https://cpython-previews--126148.org.readthedocs.build/

Open Graph Description: Adjust urllib.request.pathname2url() and url2pathname() to generate and accept file URIs as described in RFC8089. pathname2url() gains a new include_scheme argument, which defaults to false. When s...

X Description: Adjust urllib.request.pathname2url() and url2pathname() to generate and accept file URIs as described in RFC8089. pathname2url() gains a new include_scheme argument, which defaults to false. When s...

Opengraph URL: https://github.com/python/cpython/pull/126148

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:fc0a2334-4fa9-47df-a942-d309c38acc66
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC956:21DFED:DBDE7C:115D0FF:6B0233C4
html-safe-nonceacff8fb62281c67ba795061ba79f78ebee49fbac730c874277f40431e00304c0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTU2OjIxREZFRDpEQkRFN0M6MTE1RDBGRjo2QjAyMzNDNCIsInZpc2l0b3JfaWQiOiI4MzQ0Njg3NTM3Mzc3MzkxNTU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbd63f0aff1a7556dd0f04462c33b1f406125b4a781445c64a76e495e99a56d3b
hovercard-subject-tagpull_request:2152551069
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/126148/files
twitter:imagehttps://avatars.githubusercontent.com/u/960340?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/960340?s=400&v=4
og:image:altAdjust urllib.request.pathname2url() and url2pathname() to generate and accept file URIs as described in RFC8089. pathname2url() gains a new include_scheme argument, which defaults to false. When s...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
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

Links:

Skip to contenthttps://github.com/python/cpython/pull/126148/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F126148%2Ffiles
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%2Fpull%2F126148%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/126148/files
Reloadhttps://github.com/python/cpython/pull/126148/files
Reloadhttps://github.com/python/cpython/pull/126148/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
barneygalehttps://github.com/barneygale
python:mainhttps://github.com/python/cpython/tree/main
barneygale:gh-125866https://github.com/barneygale/cpython/tree/gh-125866
Conversation 2 https://github.com/python/cpython/pull/126148
Commits 12 https://github.com/python/cpython/pull/126148/commits
Checks 0 https://github.com/python/cpython/pull/126148/checks
Files changed https://github.com/python/cpython/pull/126148/files
Please reload this pagehttps://github.com/python/cpython/pull/126148/files
GH-125866: RFC8089 file URIs in urllib.request https://github.com/python/cpython/pull/126148/files#top
Show all changes 12 commits https://github.com/python/cpython/pull/126148/files
fb92f42 GH-125866: RFC8089 file URIs in `urllib.request` barneygale Oct 29, 2024 https://github.com/python/cpython/pull/126148/commits/fb92f4208df1dc2f7bf3d1a9a11f7057f5e54e74
8086522 Windows test fixes #1 barneygale Oct 29, 2024 https://github.com/python/cpython/pull/126148/commits/8086522ff6f06f091820d5c45c4e50bee994fd0f
653b9ae Windows test fixes #2 barneygale Oct 29, 2024 https://github.com/python/cpython/pull/126148/commits/653b9ae485d46149911ee188848a10d0d3b47a69
73c8bcf Windows test fixes #3, also fix docs lint barneygale Oct 29, 2024 https://github.com/python/cpython/pull/126148/commits/73c8bcf08ec578d8aa3a96aedcacb2d29d8f1a36
d4befde Windows test fixes #4 barneygale Oct 29, 2024 https://github.com/python/cpython/pull/126148/commits/d4befde7c5185fd6e974b883df63c02bf372df38
1ff26c0 Windows test fixes #5 barneygale Oct 29, 2024 https://github.com/python/cpython/pull/126148/commits/1ff26c0ca289f48119b07f58876303686dddac61
26db297 Windows test fixes #6 barneygale Oct 29, 2024 https://github.com/python/cpython/pull/126148/commits/26db297e1a0b9ead5036fd85a056e7e96c29ba0e
7584b65 Windows test fixes #7, also fix missing docs ref barneygale Oct 30, 2024 https://github.com/python/cpython/pull/126148/commits/7584b6538e89831dace0f5e21ce732dab9c9df15
a70584c Add NEWS blurb. barneygale Oct 30, 2024 https://github.com/python/cpython/pull/126148/commits/a70584c2ba5bb07c45fe33d5fbf01cf41a8dd3c0
985ef04 Comments barneygale Oct 30, 2024 https://github.com/python/cpython/pull/126148/commits/985ef04710f7d251934b7ae95b887986aafa7d11
4b99bfc Improve handling of special UNC prefixes barneygale Oct 30, 2024 https://github.com/python/cpython/pull/126148/commits/4b99bfc522f88deecb9d35f56764d58872375a8c
5c5a0b5 Merge branch 'main' into gh-125866 barneygale Oct 30, 2024 https://github.com/python/cpython/pull/126148/commits/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29
Clear filters https://github.com/python/cpython/pull/126148/files
Please reload this pagehttps://github.com/python/cpython/pull/126148/files
Please reload this pagehttps://github.com/python/cpython/pull/126148/files
urllib.request.rst https://github.com/python/cpython/pull/126148/files#diff-533bd604631e0e26ce55dfa75a878788f3c4d7d7ccb3bbaeaa2ee2a9c956ffe8
3.14.rst https://github.com/python/cpython/pull/126148/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31
nturl2path.py https://github.com/python/cpython/pull/126148/files#diff-dfd6b42c7038c17d5ca53114ad6db294c8144ed9083bd030677c668f2261cae3
test_nturl2path.py https://github.com/python/cpython/pull/126148/files#diff-f534e29ce86a5ca0ac475c0c9ed246a549db93315a907ede71c35c667e910c14
test_urllib.py https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
test_urllib2.py https://github.com/python/cpython/pull/126148/files#diff-5dcb1946f2eee26a435ec5f5e005ce2f656c6d375b8cd2c4fa789ebb09e75403
request.py https://github.com/python/cpython/pull/126148/files#diff-1b72fd8dc0aaa51a5ba3af938d3e3bdea8ab5635c0c2d9e098f9825f5b47b03f
2024-10-30-01-00-24.gh-issue-125866.hj0R4P.rst https://github.com/python/cpython/pull/126148/files#diff-b6016ed300bff82e42c701a3736a4d52cc4dbdadceee1419f300c1444a69bdc0
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L642
Doc/library/urllib.request.rsthttps://github.com/python/cpython/pull/126148/files#diff-533bd604631e0e26ce55dfa75a878788f3c4d7d7ccb3bbaeaa2ee2a9c956ffe8
View file https://github.com/barneygale/cpython/blob/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29/Doc/library/urllib.request.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/126148/{{ revealButtonHref }}
https://github.com/python/cpython/pull/126148/files#diff-533bd604631e0e26ce55dfa75a878788f3c4d7d7ccb3bbaeaa2ee2a9c956ffe8
https://github.com/python/cpython/pull/126148/files#diff-533bd604631e0e26ce55dfa75a878788f3c4d7d7ccb3bbaeaa2ee2a9c956ffe8
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L116
Doc/whatsnew/3.14.rsthttps://github.com/python/cpython/pull/126148/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31
View file https://github.com/barneygale/cpython/blob/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29/Doc/whatsnew/3.14.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/126148/{{ revealButtonHref }}
https://github.com/python/cpython/pull/126148/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31
https://github.com/python/cpython/pull/126148/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31
Lib/nturl2path.pyhttps://github.com/python/cpython/pull/126148/files#diff-dfd6b42c7038c17d5ca53114ad6db294c8144ed9083bd030677c668f2261cae3
View file https://github.com/barneygale/cpython/blob/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29/Lib/nturl2path.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/126148/{{ revealButtonHref }}
https://github.com/python/cpython/pull/126148/files#diff-dfd6b42c7038c17d5ca53114ad6db294c8144ed9083bd030677c668f2261cae3
Lib/test/test_nturl2path.pyhttps://github.com/python/cpython/pull/126148/files#diff-f534e29ce86a5ca0ac475c0c9ed246a549db93315a907ede71c35c667e910c14
View file https://github.com/barneygale/cpython/blob/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29/Lib/test/test_nturl2path.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/126148/{{ revealButtonHref }}
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L644
Lib/test/test_urllib.pyhttps://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
View file https://github.com/barneygale/cpython/blob/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29/Lib/test/test_urllib.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/126148/{{ revealButtonHref }}
https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
https://github.com/python/cpython/pull/126148/files#diff-111958b1956c05d043a3da3bcf638cff888dff68cddd71f7eeae257fc6080dcb
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L644
Lib/test/test_urllib2.pyhttps://github.com/python/cpython/pull/126148/files#diff-5dcb1946f2eee26a435ec5f5e005ce2f656c6d375b8cd2c4fa789ebb09e75403
View file https://github.com/barneygale/cpython/blob/5c5a0b54d076e6a913acc4c1dc97f7984b1a5f29/Lib/test/test_urllib2.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/126148/{{ revealButtonHref }}
https://github.com/python/cpython/pull/126148/files#diff-5dcb1946f2eee26a435ec5f5e005ce2f656c6d375b8cd2c4fa789ebb09e75403
https://github.com/python/cpython/pull/126148/files#diff-5dcb1946f2eee26a435ec5f5e005ce2f656c6d375b8cd2c4fa789ebb09e75403
https://github.com/python/cpython/pull/126148/files#diff-5dcb1946f2eee26a435ec5f5e005ce2f656c6d375b8cd2c4fa789ebb09e75403
https://github.com/python/cpython/pull/126148/files#diff-5dcb1946f2eee26a435ec5f5e005ce2f656c6d375b8cd2c4fa789ebb09e75403
Please reload this pagehttps://github.com/python/cpython/pull/126148/files
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.