René's URL Explorer Experiment


Title: urllib.request.pathname2url() mishandles UNC paths · Issue #126205 · python/cpython · GitHub

Open Graph Title: urllib.request.pathname2url() mishandles UNC paths · Issue #126205 · python/cpython

X Title: urllib.request.pathname2url() mishandles UNC paths · Issue #126205 · python/cpython

Description: Bug report Bug description: When given a Windows UNC path, urllib.request.pathname2url() incorrectly generates a URI that begins with four slashes. The correct number is two, see ref1, ref2. >>> import urllib.request >>> urllib.request.p...

Open Graph Description: Bug report Bug description: When given a Windows UNC path, urllib.request.pathname2url() incorrectly generates a URI that begins with four slashes. The correct number is two, see ref1, ref2. >>> im...

X Description: Bug report Bug description: When given a Windows UNC path, urllib.request.pathname2url() incorrectly generates a URI that begins with four slashes. The correct number is two, see ref1, ref2. >&g...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"urllib.request.pathname2url() mishandles UNC paths","articleBody":"# Bug report\n\n### Bug description:\n\nWhen given a Windows UNC path, `urllib.request.pathname2url()` incorrectly generates a URI that begins with four slashes. The correct number is two, see [ref1](https://learn.microsoft.com/en-us/archive/blogs/ie/file-uris-in-windows), [ref2](https://datatracker.ietf.org/doc/html/rfc8089#appendix-E.3.1).\n\n```python\n>>> import urllib.request\n>>> urllib.request.pathname2url(r'\\\\server\\share')\n'////server/share'\n```\n\nFurthermore, when given an extended UNC path like `\\\\?\\unc\\server\\share`, `pathname2url()` incorrectly generates a URI that begins with only one slash:\n\n```python\n>>> urllib.request.pathname2url(r'\\\\?\\unc\\server\\share')\n'/server/share'\n```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nWindows\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-126208\n* gh-126248\n* gh-126249\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2024-10-30T20:39:30Z","url":"https://github.com/python/cpython/issues/126205"}

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:d6dcaa01-e027-dc34-1604-7112e72d607c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDB22:3F8AB1:49CFE40:5D8463B:6B023346
html-safe-nonce3de88f357ff31bcb629b54157a2e7e5c1e221e5febc41d7941e451e83365dc75
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjIyOjNGOEFCMTo0OUNGRTQwOjVEODQ2M0I6NkIwMjMzNDYiLCJ2aXNpdG9yX2lkIjoiMzg5NDgzNDk4OTAxNTExODY2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc5628a55cb251916f495bef9a0a0f2699a620dfb78d96ff2e0b61858e11a989a
hovercard-subject-tagissue:2625291535
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/126205/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0a0d8c9c4f6c7d17e2b4630a81583aaa1891b5c6bb2dd549fdc95fcc292c779f/python/cpython/issues/126205
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0a0d8c9c4f6c7d17e2b4630a81583aaa1891b5c6bb2dd549fdc95fcc292c779f/python/cpython/issues/126205
og:image:altBug report Bug description: When given a Windows UNC path, urllib.request.pathname2url() incorrectly generates a URI that begins with four slashes. The correct number is two, see ref1, ref2. >>> im...
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/126205#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F126205
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%2F126205
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/126205
Reloadhttps://github.com/python/cpython/issues/126205
Reloadhttps://github.com/python/cpython/issues/126205
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/126205
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/126205
urllib.request.pathname2url() mishandles UNC pathshttps://github.com/python/cpython/issues/126205#top
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on Oct 30, 2024https://github.com/python/cpython/issues/126205#issue-2625291535
ref1https://learn.microsoft.com/en-us/archive/blogs/ie/file-uris-in-windows
ref2https://datatracker.ietf.org/doc/html/rfc8089#appendix-E.3.1
GH-126205: Fix conversion of UNC paths to file URIs #126208https://github.com/python/cpython/pull/126208
[3.12] GH-126205: Fix conversion of UNC paths to file URIs (GH-126208) #126248https://github.com/python/cpython/pull/126248
[3.13] GH-126205: Fix conversion of UNC paths to file URIs (GH-126208) #126249https://github.com/python/cpython/pull/126249
barneygalehttps://github.com/barneygale
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
on Oct 30, 2024https://github.com/python/cpython/issues/126205#event-15017896881
barneygalehttps://github.com/barneygale
on Oct 30, 2024https://github.com/python/cpython/issues/126205#event-15018038464
pythonGH-126205: Fix conversion of UNC paths to file URIshttps://github.com/barneygale/cpython/commit/76025e0779a5e3bd34cdbf08dbd9a138bf42150a
pythonGH-126205https://github.com/python/cpython/issues/126205
76025e0https://github.com/barneygale/cpython/commit/76025e0779a5e3bd34cdbf08dbd9a138bf42150a
GH-126205: Fix conversion of UNC paths to file URIs (#126208)https://github.com/python/cpython/commit/951cb2c369e8b8fb9f93662658391a53fd727787
GH-126205https://github.com/python/cpython/issues/126205
#126208https://github.com/python/cpython/pull/126208
951cb2chttps://github.com/python/cpython/commit/951cb2c369e8b8fb9f93662658391a53fd727787
miss-islingtonhttps://github.com/miss-islington
on Oct 31, 2024https://github.com/python/cpython/issues/126205#event-15040418268
pythonGH-126205: Fix conversion of UNC paths to file URIs (pythonGH-1…https://github.com/miss-islington/cpython/commit/63e1151e89c41c11a3483aeb7a8aa31dfdbc5bfe
pythonGH-126205https://github.com/python/cpython/issues/126205
pythonGH-1…https://github.com/python/cpython/pull/126208
63e1151https://github.com/miss-islington/cpython/commit/63e1151e89c41c11a3483aeb7a8aa31dfdbc5bfe
pythonGH-126205: Fix conversion of UNC paths to file URIs (pythonGH-1…https://github.com/miss-islington/cpython/commit/1e81eb845c53236b99d6e965f85386213e697bfe
pythonGH-126205https://github.com/python/cpython/issues/126205
pythonGH-1…https://github.com/python/cpython/pull/126208
1e81eb8https://github.com/miss-islington/cpython/commit/1e81eb845c53236b99d6e965f85386213e697bfe
barneygalehttps://github.com/barneygale
on Oct 31, 2024https://github.com/python/cpython/issues/126205#event-15041751471
[3.13] GH-126205: Fix conversion of UNC paths to file URIs (GH-126208) (https://github.com/python/cpython/commit/588da2e26a986cb94d9e2aee57f6ecd965adf918
GH-126205https://github.com/python/cpython/issues/126205
GH-126208https://github.com/python/cpython/pull/126208
588da2ehttps://github.com/python/cpython/commit/588da2e26a986cb94d9e2aee57f6ecd965adf918
[3.12] GH-126205: Fix conversion of UNC paths to file URIs (GH-126208) (https://github.com/python/cpython/commit/78f307f39e6d3f4ebb172140945ad2ec1ee10811
GH-126205https://github.com/python/cpython/issues/126205
GH-126208https://github.com/python/cpython/pull/126208
78f307fhttps://github.com/python/cpython/commit/78f307f39e6d3f4ebb172140945ad2ec1ee10811
barneygalehttps://github.com/barneygale
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 3, 2024https://github.com/python/cpython/issues/126205#event-15096041899
barneygalehttps://github.com/barneygale
on Nov 23, 2024https://github.com/python/cpython/issues/126205#event-15407666155
pythonGH-126148: `pathname2url()`: add authority section for absolute…https://github.com/barneygale/cpython/commit/1b2d2e0413cec077acef3fe8adccd6b91a1c550e
pythonGH-126148https://github.com/python/cpython/pull/126148
1b2d2e0https://github.com/barneygale/cpython/commit/1b2d2e0413cec077acef3fe8adccd6b91a1c550e
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Nov 24, 2024https://github.com/python/cpython/issues/126205#issuecomment-2495915083
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on Nov 24, 2024https://github.com/python/cpython/issues/126205#issuecomment-2496044408
https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775098(v=vs.85)#creating-file-schemes-from-file-pathshttps://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775098(v=vs.85)#creating-file-schemes-from-file-paths
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on Nov 24, 2024https://github.com/python/cpython/issues/126205#issuecomment-2496051624
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Nov 24, 2024https://github.com/python/cpython/issues/126205#issuecomment-2496142575
barneygalehttps://github.com/barneygale
on Nov 25, 2024https://github.com/python/cpython/issues/126205#event-15426071735
GH-127236: `pathname2url()`: generate RFC 1738 URL for absolute POSIX…https://github.com/python/cpython/commit/5bb059fe606983814a445e4dcf9e96fd7cb4951a
GH-127236https://github.com/python/cpython/issues/127236
5bb059fhttps://github.com/python/cpython/commit/5bb059fe606983814a445e4dcf9e96fd7cb4951a
picnixzhttps://github.com/picnixz
on Dec 8, 2024https://github.com/python/cpython/issues/126205#event-15572736934
pythonGH-126205: Fix conversion of UNC paths to file URIs (python#126208https://github.com/picnixz/cpython/commit/68c151c80037f90029fc07e26a929f7dffba031c
pythonGH-126205https://github.com/python/cpython/issues/126205
python#126208https://github.com/python/cpython/pull/126208
68c151chttps://github.com/picnixz/cpython/commit/68c151c80037f90029fc07e26a929f7dffba031c
ebonnalhttps://github.com/ebonnal
on Jan 12, 2025https://github.com/python/cpython/issues/126205#event-15894559301
pythonGH-126205: Fix conversion of UNC paths to file URIs (python#126208https://github.com/ebonnal/cpython/commit/132ce80a3e9bd8454ef067c2038b24e9eef853d8
pythonGH-126205https://github.com/python/cpython/issues/126205
python#126208https://github.com/python/cpython/pull/126208
132ce80https://github.com/ebonnal/cpython/commit/132ce80a3e9bd8454ef067c2038b24e9eef853d8
pythonGH-127236: `pathname2url()`: generate RFC 1738 URL for absolute…https://github.com/ebonnal/cpython/commit/a94803d5db500d937a38dce66d0782cb018cc7a0
pythonGH-127236https://github.com/python/cpython/issues/127236
a94803dhttps://github.com/ebonnal/cpython/commit/a94803d5db500d937a38dce66d0782cb018cc7a0
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/126205
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/126205
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%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.