René's URL Explorer Experiment


Title: nturl2path does not use the filesystem error handler on Windows · Issue #156713 · python/cpython · GitHub

Open Graph Title: nturl2path does not use the filesystem error handler on Windows · Issue #156713 · python/cpython

X Title: nturl2path does not use the filesystem error handler on Windows · Issue #156713 · python/cpython

Description: gh-85168 made urllib.request.pathname2url() and url2pathname() use the filesystem encoding and error handler instead of forcing UTF-8, but the nturl2path module was left unchanged: "No changes are needed in the nturl2path module because ...

Open Graph Description: gh-85168 made urllib.request.pathname2url() and url2pathname() use the filesystem encoding and error handler instead of forcing UTF-8, but the nturl2path module was left unchanged: "No changes are ...

X Description: gh-85168 made urllib.request.pathname2url() and url2pathname() use the filesystem encoding and error handler instead of forcing UTF-8, but the nturl2path module was left unchanged: "No changes...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"nturl2path does not use the filesystem error handler on Windows","articleBody":"gh-85168 made `urllib.request.pathname2url()` and `url2pathname()` use the filesystem encoding and error handler instead of forcing UTF-8, but the `nturl2path` module was left unchanged: \"No changes are needed in the `nturl2path` module because Windows always uses UTF-8, per PEP 529\".\n\nThat is only half true.  A Windows path is a sequence of 16-bit code units, and unpaired surrogates are allowed in it.  Python decodes such a name with the filesystem error handler `surrogatepass`, so the resulting string contains a lone surrogate, which `urllib.parse.quote()` cannot encode with the default `strict` handler:\n\n```pycon\n>>> import sys, nturl2path\n>>> sys.getfilesystemencoding(), sys.getfilesystemencodeerrors()\n('utf-8', 'surrogatepass')\n>>> nturl2path.pathname2url('C:\\\\a\\\\b\\udd00')\nTraceback (most recent call last):\n  ...\n  File \"Lib\\nturl2path.py\", line 68, in pathname2url\n    tail = urllib.parse.quote(comp[1])\nUnicodeEncodeError: 'utf-8' codec can't encode character '\\udd00' in position 4: surrogates not allowed\n```\n\n`quote()` and `unquote()` should be called with `encoding=sys.getfilesystemencoding()` and `errors=sys.getfilesystemencodeerrors()`, as in `urllib.request`.\n\nIn 3.13 this is reachable through `urllib.request.pathname2url()`, which uses `nturl2path` on Windows.  It is why the fix for gh-69371 cannot be backported to 3.13 as is (GH-156610 fails on Windows).  Since 3.14 the module is deprecated and `urllib.request` no longer uses it, so only direct users are affected.\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156717\n* gh-157423\n* gh-157424\n* gh-157425\n* gh-157461\n* gh-157462\n* gh-157464\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2026-08-31T13:57:59Z","url":"https://github.com/python/cpython/issues/156713"}

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:624ee99f-9cda-b053-eaa5-b55cd1fedc25
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC7CC:65478:37168A7:49165D0:6B020399
html-safe-nonce13217f649333385586d787e7f0d8b8770b9b0afc0b250760fc816b420960ffd6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0NDOjY1NDc4OjM3MTY4QTc6NDkxNjVEMDo2QjAyMDM5OSIsInZpc2l0b3JfaWQiOiIzNDQ3NzExMzE0MjAwMzYzOTI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6ac47099856587f17049cebc62dd22686a76162d0012ab5bf6290c88553293d1
hovercard-subject-tagissue:5301017959
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/156713/issue_layout
twitter:imagehttps://opengraph.githubassets.com/da21e92ac5b1d2473b901c24b9a98e931d66fe6e080cc01cfee627606f562a44/python/cpython/issues/156713
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/da21e92ac5b1d2473b901c24b9a98e931d66fe6e080cc01cfee627606f562a44/python/cpython/issues/156713
og:image:altgh-85168 made urllib.request.pathname2url() and url2pathname() use the filesystem encoding and error handler instead of forcing UTF-8, but the nturl2path module was left unchanged: "No changes are ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameserhiy-storchaka
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/156713#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F156713
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%2F156713
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/156713
Reloadhttps://github.com/python/cpython/issues/156713
Reloadhttps://github.com/python/cpython/issues/156713
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/156713
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/156713
nturl2path does not use the filesystem error handler on Windowshttps://github.com/python/cpython/issues/156713#top
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Aug 31, 2026https://github.com/python/cpython/issues/156713#issue-5301017959
gh-85168https://github.com/python/cpython/issues/85168
gh-69371https://github.com/python/cpython/issues/69371
GH-156610https://github.com/python/cpython/pull/156610
gh-156713: Use the filesystem encoding in nturl2path #156717https://github.com/python/cpython/pull/156717
[3.15] gh-156713: Use the filesystem encoding in nturl2path (GH-156717) #157423https://github.com/python/cpython/pull/157423
[3.14] gh-156713: Use the filesystem encoding in nturl2path (GH-156717) #157424https://github.com/python/cpython/pull/157424
[3.13] gh-156713: Use the filesystem encoding in nturl2path (GH-156717) #157425https://github.com/python/cpython/pull/157425
gh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodings #157461https://github.com/python/cpython/pull/157461
[3.14] gh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodings (GH-157461) #157462https://github.com/python/cpython/pull/157462
[3.13] gh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodings (GH-157461) #157464https://github.com/python/cpython/pull/157464
aiskhttps://github.com/aisk
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on Aug 31, 2026https://github.com/python/cpython/issues/156713#event-30284108100
aiskhttps://github.com/aisk
Urllib issueshttps://github.com/orgs/python/projects/60
on Aug 31, 2026https://github.com/python/cpython/issues/156713#event-30284276989
github-project-automationhttps://github.com/apps/github-project-automation
Urllib issueshttps://github.com/orgs/python/projects/60
on Aug 31, 2026https://github.com/python/cpython/issues/156713
serhiy-storchakahttps://github.com/serhiy-storchaka
on Sep 13, 2026https://github.com/python/cpython/issues/156713#event-31052286770
gh-156713: Use the filesystem encoding in nturl2path (GH-156717)https://github.com/python/cpython/commit/01599e203e25610421bb5df413f32fa0848f3ade
gh-156713https://github.com/python/cpython/issues/156713
GH-156717https://github.com/python/cpython/pull/156717
01599e2https://github.com/python/cpython/commit/01599e203e25610421bb5df413f32fa0848f3ade
serhiy-storchakahttps://github.com/serhiy-storchaka
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 13, 2026https://github.com/python/cpython/issues/156713#event-31052430414
github-project-automationhttps://github.com/apps/github-project-automation
Urllib issueshttps://github.com/orgs/python/projects/60
on Sep 13, 2026https://github.com/python/cpython/issues/156713
serhiy-storchakahttps://github.com/serhiy-storchaka
on Sep 13, 2026https://github.com/python/cpython/issues/156713#event-31052907766
[3.14] gh-156713: Use the filesystem encoding in nturl2path (GH-156717)…https://github.com/python/cpython/commit/f66a784c5393e56566b9c9448010d87e166f9be3
gh-156713https://github.com/python/cpython/issues/156713
GH-156717https://github.com/python/cpython/pull/156717
f66a784https://github.com/python/cpython/commit/f66a784c5393e56566b9c9448010d87e166f9be3
[3.13] gh-156713: Use the filesystem encoding in nturl2path (GH-156717)…https://github.com/python/cpython/commit/b871e39ff57fd769b91fd6d717d080cc4623fd03
gh-156713https://github.com/python/cpython/issues/156713
GH-156717https://github.com/python/cpython/pull/156717
b871e39https://github.com/python/cpython/commit/b871e39ff57fd769b91fd6d717d080cc4623fd03
pythongh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodingshttps://github.com/miss-islington/cpython/commit/94eb4f8dfaafc9e9c84a54b2f6f9462145c3cae8
pythongh-156713https://github.com/python/cpython/issues/156713
94eb4f8https://github.com/miss-islington/cpython/commit/94eb4f8dfaafc9e9c84a54b2f6f9462145c3cae8
gh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodings (GH…https://github.com/python/cpython/commit/fd0970c0ab7eb8c685ef9e5476f36e7d108c19ac
gh-156713https://github.com/python/cpython/issues/156713
GH…https://github.com/python/cpython/pull/157461
fd0970chttps://github.com/python/cpython/commit/fd0970c0ab7eb8c685ef9e5476f36e7d108c19ac
[3.13] pythongh-156713: Fix test_nturl2path for non-UTF-8 filesystem …https://github.com/serhiy-storchaka/cpython/commit/94ec3d330e4158957d340e363d25165888f98a10
pythongh-156713https://github.com/python/cpython/issues/156713
94ec3d3https://github.com/serhiy-storchaka/cpython/commit/94ec3d330e4158957d340e363d25165888f98a10
[3.14] gh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodi…https://github.com/python/cpython/commit/0ad0330ba6602091e42a0252bd4c9a7f1eb93b02
gh-156713https://github.com/python/cpython/issues/156713
0ad0330https://github.com/python/cpython/commit/0ad0330ba6602091e42a0252bd4c9a7f1eb93b02
[3.13] gh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodi…https://github.com/python/cpython/commit/1dfd6d55b734fe3a4ccc2234e7df70550f5ab3b1
gh-156713https://github.com/python/cpython/issues/156713
1dfd6d5https://github.com/python/cpython/commit/1dfd6d55b734fe3a4ccc2234e7df70550f5ab3b1
johnslavikhttps://github.com/johnslavik
on Sep 14, 2026https://github.com/python/cpython/issues/156713#event-31099062732
pythongh-156713: Use the filesystem encoding in nturl2path (pythonGH-…https://github.com/johnslavik/cpython/commit/9c627b3c5ad02bece70e1ea015ae120a88a3a62c
pythongh-156713https://github.com/python/cpython/issues/156713
pythonGH-…https://github.com/python/cpython/pull/156717
9c627b3https://github.com/johnslavik/cpython/commit/9c627b3c5ad02bece70e1ea015ae120a88a3a62c
pythongh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodin…https://github.com/johnslavik/cpython/commit/8074d78404e9b6d2538513ce519d69b70ad7feca
pythongh-156713https://github.com/python/cpython/issues/156713
8074d78https://github.com/johnslavik/cpython/commit/8074d78404e9b6d2538513ce519d69b70ad7feca
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 10, 2026https://github.com/python/cpython/issues/156713#event-32935273079
[3.15] gh-156713: Use the filesystem encoding in nturl2path (GH-156717)…https://github.com/python/cpython/commit/ff92d4b2b8c534e1357963d843cf4bd7c8cdfad7
gh-156713https://github.com/python/cpython/issues/156713
GH-156717https://github.com/python/cpython/pull/156717
ff92d4bhttps://github.com/python/cpython/commit/ff92d4b2b8c534e1357963d843cf4bd7c8cdfad7
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/156713
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/156713
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Urllib issueshttps://github.com/orgs/python/projects/60
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.