Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-156713: Use the filesystem encoding in nturl2path - #156717

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-156713-nturl2path
Sep 13, 2026
Merged

gh-156713: Use the filesystem encoding in nturl2path#156717
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-156713-nturl2path

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

urllib.request.pathname2url() and url2pathname() use the filesystem encoding and error handler since gh-85168, but the nturl2path module, which implemented them on Windows before 3.14, was left unchanged. Paths containing surrogate characters raised UnicodeEncodeError.

urllib.request.pathname2url() and url2pathname() use the filesystem encoding
and error handler since pythongh-85168, but nturl2path, which implements them on
Windows before 3.14, was left unchanged.  Paths containing surrogate
characters raised UnicodeEncodeError.
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 31, 2026
@serhiy-storchaka
serhiy-storchaka merged commit 01599e2 into python:main Sep 13, 2026
59 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@serhiy-storchaka
serhiy-storchaka deleted the gh-156713-nturl2path branch September 13, 2026 12:44
@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 01599e203e25610421bb5df413f32fa0848f3ade 3.13

@bedevere-app

bedevere-app Bot commented Sep 13, 2026

Copy link
Copy Markdown

GH-157423 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 13, 2026
@bedevere-app

bedevere-app Bot commented Sep 13, 2026

Copy link
Copy Markdown

GH-157424 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 13, 2026
@bedevere-app

bedevere-app Bot commented Sep 13, 2026

Copy link
Copy Markdown

GH-157425 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Sep 13, 2026
serhiy-storchaka added a commit that referenced this pull request Sep 13, 2026
… (GH-157424)

urllib.request.pathname2url() and url2pathname() use the filesystem encoding
and error handler since gh-85168, but nturl2path, which implements them on
Windows before 3.14, was left unchanged.  Paths containing surrogate
characters raised UnicodeEncodeError.
(cherry picked from commit 01599e2)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Sep 13, 2026
… (GH-157425)

urllib.request.pathname2url() and url2pathname() use the filesystem encoding
and error handler since gh-85168, but nturl2path, which implements them on
Windows before 3.14, was left unchanged.  Paths containing surrogate
characters raised UnicodeEncodeError.
(cherry picked from commit 01599e2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant