]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-85168: Use filesystem encoding when converting to/from `file` URIs (#126852)
authorBarney Gale <barney.gale@gmail.com>
Tue, 19 Nov 2024 21:19:30 +0000 (21:19 +0000)
committerGitHub <noreply@github.com>
Tue, 19 Nov 2024 21:19:30 +0000 (21:19 +0000)
commitc9b399fbdb01584dcfff0d7f6ad484644ff269c3
tree4e7fe4fa8d106d35597ec8c2f969e7e58ba9517c
parent2cdfb41d0c3bfea37983fc872951bc3b2a4d90b8
GH-85168: Use filesystem encoding when converting to/from `file` URIs (#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.
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]