diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-05-14 09:24:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-14 09:24:37 (GMT) |
commit | e237b25a4fa5626fcd1b1848aa03f725f892e40e (patch) | |
tree | 4c01689fcba232ef9f4c1df4299d556a2322e12d /Lib/urllib/parse.py | |
parent | e04cd964eb4eee1b0ae5b2c34727abce6c0fb7f0 (diff) | |
download | cpython-e237b25a4fa5626fcd1b1848aa03f725f892e40e.zip cpython-e237b25a4fa5626fcd1b1848aa03f725f892e40e.tar.gz cpython-e237b25a4fa5626fcd1b1848aa03f725f892e40e.tar.bz2 |
gh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority (GH-113563)
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r-- | Lib/urllib/parse.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index fc9e7c9..3932bb9 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -525,7 +525,7 @@ def urlunsplit(components): empty query; the RFC states that these are equivalent).""" scheme, netloc, url, query, fragment, _coerce_result = ( _coerce_args(*components)) - if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'): + if netloc or (scheme and scheme in uses_netloc) or url[:2] == '//': if url and url[:1] != '/': url = '/' + url url = '//' + (netloc or '') + url if scheme: |