]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 14 Nov 2024 23:52:46 +0000 (00:52 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2024 23:52:46 +0000 (23:52 +0000)
commit04f38bb775e998e78bb0cb2747ef57f50f129cb5
treed6e59cac6dfaf39397cae4ca14b593c86ea14eaf
parent306db142c274f186da951a68fe5121330da91151
[3.12] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) (#126837)

GH-126766: `url2pathname()`: handle empty authority section. (GH-126767)

Discard two leading slashes from the beginning of a `file:` URI if they
introduce an empty authority section. As a result, file URIs like
`///etc/hosts` are correctly parsed as `/etc/hosts`.
(cherry picked from commit cae9d9d20f61cdbde0765efa340b6b596c31b67f)

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-12-21-43-12.gh-issue-126766.oi2KJ7.rst [new file with mode: 0644]