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
bbc0568a
Commit
bbc0568a
authored
Oct 14, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for 1.33: urlsplit() should only add '//' if scheme != ''.
Will add test and backport.
parent
6e75364c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
Lib/test/test_urlparse.py
Lib/test/test_urlparse.py
+6
-1
Lib/urlparse.py
Lib/urlparse.py
+1
-1
No files found.
Lib/test/test_urlparse.py
View file @
bbc0568a
...
...
@@ -27,7 +27,12 @@ class UrlParseTestCase(unittest.TestCase):
self
.
assertEqual
(
result2
,
url
)
def
checkJoin
(
self
,
base
,
relurl
,
expected
):
self
.
assertEqual
(
urlparse
.
urljoin
(
base
,
relurl
),
expected
)
self
.
assertEqual
(
urlparse
.
urljoin
(
base
,
relurl
),
expected
,
(
base
,
relurl
,
expected
))
def
test_unparse_parse
(
self
):
for
u
in
[
'Python'
,
'./Python'
]:
self
.
assertEqual
(
urlparse
.
urlunparse
(
urlparse
.
urlparse
(
u
)),
u
)
def
test_RFC1808
(
self
):
# "normal" cases from RFC 1808:
...
...
Lib/urlparse.py
View file @
bbc0568a
...
...
@@ -128,7 +128,7 @@ def urlunparse((scheme, netloc, url, params, query, fragment)):
return
urlunsplit
((
scheme
,
netloc
,
url
,
query
,
fragment
))
def
urlunsplit
((
scheme
,
netloc
,
url
,
query
,
fragment
)):
if
netloc
or
(
scheme
in
uses_netloc
and
url
[:
2
]
!=
'//'
):
if
netloc
or
(
scheme
and
scheme
in
uses_netloc
and
url
[:
2
]
!=
'//'
):
if
url
and
url
[:
1
]
!=
'/'
:
url
=
'/'
+
url
url
=
'//'
+
(
netloc
or
''
)
+
url
if
scheme
:
...
...
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