]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 20 Nov 2024 20:10:29 +0000 (21:10 +0100)
committerGitHub <noreply@github.com>
Wed, 20 Nov 2024 20:10:29 +0000 (20:10 +0000)
commit746a0c5bc8979d6265e9669987eff52e7631222a
tree1cecd33fbd15458dac64ad3c0ed880f3fed53ae9
parent40b9b506fb88c5cb6d36617015d74b2cf21da43d
[3.13] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852) (#127039)

GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852)

Adjust `urllib.request.url2pathname()` and `pathname2url()` to use the
filesystem encoding when quoting and unquoting file URIs, rather than
forcing use of UTF-8.

No changes are needed in the `nturl2path` module because Windows always
uses UTF-8, per PEP 529.
(cherry picked from commit c9b399fbdb01584dcfff0d7f6ad484644ff269c3)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Lib/test/test_urllib.py
Lib/test/test_urllib2.py
Lib/urllib/request.py
Misc/NEWS.d/next/Library/2024-11-15-01-50-36.gh-issue-85168.bP8VIN.rst [new file with mode: 0644]