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

Skip to content

[3.13] gh-156713: Use the filesystem encoding in nturl2path (GH-156717) - #157425

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-01599e2-3.13
Sep 13, 2026
Merged

[3.13] gh-156713: Use the filesystem encoding in nturl2path (GH-156717)#157425
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-01599e2-3.13

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.

Manual backport: 3.13 still has the old nturl2path implementation and no test_nturl2path, so the tests were added to test_urllib.Pathname_Tests.

(cherry picked from commit 01599e2)

…thonGH-156717)

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.
(cherry picked from commit 01599e2)

Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) September 13, 2026 12:50
@serhiy-storchaka
serhiy-storchaka merged commit b871e39 into python:3.13 Sep 13, 2026
43 of 44 checks passed
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