René's URL Explorer Experiment


Title: urllib.request.pathname2url() and url2pathname() remove slashes on Windows · Issue #126212 · python/cpython · GitHub

Open Graph Title: urllib.request.pathname2url() and url2pathname() remove slashes on Windows · Issue #126212 · python/cpython

X Title: urllib.request.pathname2url() and url2pathname() remove slashes on Windows · Issue #126212 · python/cpython

Description: Bug report Bug description: urllib.request.pathname2url() unexpectedly removes doubled and trailing slashes, but only on Windows, and only for DOS device paths (not UNC paths): >>> from urllib.request import pathname2url, url2pathname >>...

Open Graph Description: Bug report Bug description: urllib.request.pathname2url() unexpectedly removes doubled and trailing slashes, but only on Windows, and only for DOS device paths (not UNC paths): >>> from urllib.requ...

X Description: Bug report Bug description: urllib.request.pathname2url() unexpectedly removes doubled and trailing slashes, but only on Windows, and only for DOS device paths (not UNC paths): >>> from ur...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"urllib.request.pathname2url() and url2pathname() remove slashes on Windows","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\n`urllib.request.pathname2url()` unexpectedly removes doubled and trailing slashes, but only on Windows, and only for DOS device paths (not UNC paths):\r\n\r\n```python\r\n>>> from urllib.request import pathname2url, url2pathname\r\n>>> pathname2url('C:\\\\')\r\n'///C:'  # This is *not* the same path!\r\n>>> pathname2url('C:\\\\foo\\\\')\r\n'///C:/foo'\r\n>>> pathname2url('C:\\\\foo\\\\\\\\bar')\r\n'///C:/foo/bar'\r\n```\r\n\r\n`url2pathname()` does almost the same thing, except that it specially preserves a slash immediately after a DOS drive (but not elsewhere):\r\n\r\n```python\r\n>>> url2pathname('///c:/')\r\n'C:\\\\'  # OK\r\n>>> url2pathname('///c:/foo/')\r\n'C:\\\\foo'\r\n>>> url2pathname('///c:/foo//bar')\r\n'C:\\\\foo\\\\bar'\r\n```\r\n\r\nThis behaviour makes no sense and has no equivalent on POSIX, where all slashes are preserved.\r\n\r\n### CPython versions tested on:\r\n\r\nCPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\nWindows\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-126214\n* gh-126590\n* gh-126591\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2024-10-30T23:52:07Z","url":"https://github.com/python/cpython/issues/126212"}

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:c4400178-1249-8dd4-c299-d6944cc46b10
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE22E:3A73AA:3B4EEEC:4B1496B:6B023AA4
html-safe-nonce2d308550d44a018c21d422f1360ea3d841b7fab2386cbc0a71a08d9fa9f40171
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjJFOjNBNzNBQTozQjRFRUVDOjRCMTQ5NkI6NkIwMjNBQTQiLCJ2aXNpdG9yX2lkIjoiMzY5MTY4MTQyOTU5NjU1MTg0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac53bc145acb5b3fa1a5efffcecb58cf2e68d5598aeedde0a0490a524629c38055
hovercard-subject-tagissue:2625616097
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/126212/issue_layout
twitter:imagehttps://opengraph.githubassets.com/57500e1f368ca20ee6c352fe02cafbd003c562b2817479de66eeaae7a6d9e9d5/python/cpython/issues/126212
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/57500e1f368ca20ee6c352fe02cafbd003c562b2817479de66eeaae7a6d9e9d5/python/cpython/issues/126212
og:image:altBug report Bug description: urllib.request.pathname2url() unexpectedly removes doubled and trailing slashes, but only on Windows, and only for DOS device paths (not UNC paths): >>> from urllib.requ...
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/126212#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F126212
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%2F126212
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/126212
Reloadhttps://github.com/python/cpython/issues/126212
Reloadhttps://github.com/python/cpython/issues/126212
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/126212
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/126212
urllib.request.pathname2url() and url2pathname() remove slashes on Windowshttps://github.com/python/cpython/issues/126212#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/126212#issue-2625616097
GH-126212: Fix removal of slashes in file URIs on Windows #126214https://github.com/python/cpython/pull/126214
[3.13] GH-126212: Fix removal of slashes in file URIs on Windows (GH-126214) #126590https://github.com/python/cpython/pull/126590
[3.12] GH-126212: Fix removal of slashes in file URIs on Windows (GH-126214) #126591https://github.com/python/cpython/pull/126591
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/126212#event-15020926550
barneygalehttps://github.com/barneygale
on Oct 31, 2024https://github.com/python/cpython/issues/126212#event-15021052429
pythonGH-126212: Fix removal of slashes in file URIs on Windowshttps://github.com/barneygale/cpython/commit/e3a81cba0b0e1b169ba2fb43035190c3923eb108
pythonGH-126212https://github.com/python/cpython/issues/126212
e3a81cbhttps://github.com/barneygale/cpython/commit/e3a81cba0b0e1b169ba2fb43035190c3923eb108
barneygalehttps://github.com/barneygale
on Nov 8, 2024https://github.com/python/cpython/issues/126212#event-15219886621
GH-126212: Fix removal of slashes in file URIs on Windows (#126214)https://github.com/python/cpython/commit/54c63a32d06cb5f07a66245c375eac7d7efb964a
GH-126212https://github.com/python/cpython/issues/126212
#126214https://github.com/python/cpython/pull/126214
54c63a3https://github.com/python/cpython/commit/54c63a32d06cb5f07a66245c375eac7d7efb964a
miss-islingtonhttps://github.com/miss-islington
on Nov 8, 2024https://github.com/python/cpython/issues/126212#event-15219889114
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…https://github.com/miss-islington/cpython/commit/71b4e1656c258017d77680eeb12a66f752fddbae
pythonGH-126212https://github.com/python/cpython/issues/126212
pyth…https://github.com/python/cpython/pull/126214
71b4e16https://github.com/miss-islington/cpython/commit/71b4e1656c258017d77680eeb12a66f752fddbae
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…https://github.com/miss-islington/cpython/commit/4cc576fafdcb4a4485667da5ced79b407bc5b93d
pythonGH-126212https://github.com/python/cpython/issues/126212
pyth…https://github.com/python/cpython/pull/126214
4cc576fhttps://github.com/miss-islington/cpython/commit/4cc576fafdcb4a4485667da5ced79b407bc5b93d
barneygalehttps://github.com/barneygale
on Nov 8, 2024https://github.com/python/cpython/issues/126212#event-15220992244
[3.12] GH-126212: Fix removal of slashes in file URIs on Windows (GH-…https://github.com/python/cpython/commit/5fb443d6254d53f43acb0b39a7615d56f4fc7355
GH-126212https://github.com/python/cpython/issues/126212
GH-…https://github.com/python/cpython/pull/126214
5fb443dhttps://github.com/python/cpython/commit/5fb443d6254d53f43acb0b39a7615d56f4fc7355
[3.13] GH-126212: Fix removal of slashes in file URIs on Windows (GH-…https://github.com/python/cpython/commit/20043d5cf4815028c4a1a75a109bf97e2feeb207
GH-126212https://github.com/python/cpython/issues/126212
GH-…https://github.com/python/cpython/pull/126214
20043d5https://github.com/python/cpython/commit/20043d5cf4815028c4a1a75a109bf97e2feeb207
barneygalehttps://github.com/barneygale
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 8, 2024https://github.com/python/cpython/issues/126212#event-15222625297
picnixzhttps://github.com/picnixz
on Dec 8, 2024https://github.com/python/cpython/issues/126212#event-15572738476
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…https://github.com/picnixz/cpython/commit/2866578b7fdb95d8f9c7aeddd7715b844f387c6f
pythonGH-126212https://github.com/python/cpython/issues/126212
pyth…https://github.com/python/cpython/pull/126214
2866578https://github.com/picnixz/cpython/commit/2866578b7fdb95d8f9c7aeddd7715b844f387c6f
ebonnalhttps://github.com/ebonnal
on Jan 12, 2025https://github.com/python/cpython/issues/126212#event-15894560537
pythonGH-126212: Fix removal of slashes in file URIs on Windows (pyth…https://github.com/ebonnal/cpython/commit/aa42b83e06481caa64698b095d3a62e2eda01ebc
pythonGH-126212https://github.com/python/cpython/issues/126212
pyth…https://github.com/python/cpython/pull/126214
aa42b83https://github.com/ebonnal/cpython/commit/aa42b83e06481caa64698b095d3a62e2eda01ebc
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/126212
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/126212
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.