]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127131)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 22 Nov 2024 03:42:46 +0000 (04:42 +0100)
committerGitHub <noreply@github.com>
Fri, 22 Nov 2024 03:42:46 +0000 (03:42 +0000)
commit4b705f50d1c65536e19048b32397e8118d92558d
tree2b93332f07130bfd02e148651fdc85600e8a1b7d
parent4b4e0dbdf49adc91c35a357ad332ab3abd4c31b1
[3.12] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127131)

GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129)

Discard any 'localhost' authority from the beginning of a `file:` URI. As a
result, file URIs like `//localhost/etc/hosts` are correctly decoded as
`/etc/hosts`.
(cherry picked from commit ebf564a1d3e2e81b9846535114e481d6096443d2)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Lib/nturl2path.py
Lib/test/test_urllib.py
Lib/urllib/request.py
Misc/NEWS.d/next/Library/2024-11-22-02-31-55.gh-issue-126766.jfkhBH.rst [new file with mode: 0644]