diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-04-15 23:31:14 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-04-15 23:31:14 (GMT) |
commit | 20416f7994d1efbca1158e549ec8ece5ac4dbb67 (patch) | |
tree | eefd703fc863c220964e3a81d0136ba68c0579ff /Lib/urllib/parse.py | |
parent | d2bc389e550464e3f71ec60071880335e8f9b6c6 (diff) | |
download | cpython-20416f7994d1efbca1158e549ec8ece5ac4dbb67.zip cpython-20416f7994d1efbca1158e549ec8ece5ac4dbb67.tar.gz cpython-20416f7994d1efbca1158e549ec8ece5ac4dbb67.tar.bz2 |
Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a.
Patch by Demian Brecht.
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r-- | Lib/urllib/parse.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 6012d35..e313371 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -447,8 +447,7 @@ def urljoin(base, url, allow_fragments=True): segments = base_parts + path.split('/') # filter out elements that would cause redundant slashes on re-joining # the resolved_path - segments = segments[0:1] + [ - s for s in segments[1:-1] if len(s) > 0] + segments[-1:] + segments[1:-1] = filter(None, segments[1:-1]) resolved_path = [] |