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

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]