diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-14 09:47:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-14 09:47:05 (GMT) |
commit | 872000606271c52d989e53fe4cc9904343d81855 (patch) | |
tree | 6997a88ef80f2162ebfbddada1e17c484e94cfe9 /Lib/urllib/parse.py | |
parent | 29a2f9cc286f6cef8a359fc7022fe9d480a2eb79 (diff) | |
download | cpython-872000606271c52d989e53fe4cc9904343d81855.zip cpython-872000606271c52d989e53fe4cc9904343d81855.tar.gz cpython-872000606271c52d989e53fe4cc9904343d81855.tar.bz2 |
[3.13] gh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority (GH-113563) (GH-119023)
(cherry picked from commit e237b25a4fa5626fcd1b1848aa03f725f892e40e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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: |