Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
20416f79
Commit
20416f79
authored
Apr 16, 2015
by
Berker Peksag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a.
Patch by Demian Brecht.
parent
d2bc389e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
Lib/test/test_urlparse.py
Lib/test/test_urlparse.py
+3
-0
Lib/urllib/parse.py
Lib/urllib/parse.py
+1
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urlparse.py
View file @
20416f79
...
...
@@ -391,6 +391,9 @@ class UrlParseTestCase(unittest.TestCase):
self
.
checkJoin
(
'http://a/b/c/d/e/'
,
'../../f/g'
,
'http://a/b/c/f/g'
)
self
.
checkJoin
(
'http://a/b/'
,
'../../f/g/'
,
'http://a/f/g/'
)
# issue 23703: don't duplicate filename
self
.
checkJoin
(
'a'
,
'b'
,
'b'
)
def
test_RFC2732
(
self
):
str_cases
=
[
(
'http://Test.python.org:5432/foo/'
,
'test.python.org'
,
5432
),
...
...
Lib/urllib/parse.py
View file @
20416f79
...
...
@@ -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
=
[]
...
...
Misc/NEWS
View file @
20416f79
...
...
@@ -36,6 +36,9 @@ Core and Builtins
Library
-------
- Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a.
Patch by Demian Brecht.
- Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
- Issue 19933: Provide default argument for ndigits in round. Patch by
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment