]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-126766: `url2pathname()`: handle empty authority section. (#126767)
authorBarney Gale <barney.gale@gmail.com>
Thu, 14 Nov 2024 20:22:14 +0000 (20:22 +0000)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2024 20:22:14 +0000 (20:22 +0000)
commitcae9d9d20f61cdbde0765efa340b6b596c31b67f
tree72fd81537fbe2b3989fbaf3f952ad8c65da7d0f7
parent47cbf038850852cdcbe7a404ed7c64542340d58a
GH-126766: `url2pathname()`: handle empty authority section. (#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`.
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]