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
b4bd4af8
Commit
b4bd4af8
authored
Apr 15, 2011
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Plain Diff
merge from 3.1
parents
82b0d5d1
397eb441
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
Lib/test/test_urlparse.py
Lib/test/test_urlparse.py
+5
-0
Lib/urllib/parse.py
Lib/urllib/parse.py
+10
-5
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urlparse.py
View file @
b4bd4af8
...
...
@@ -228,6 +228,11 @@ class UrlParseTestCase(unittest.TestCase):
#self.checkJoin(RFC1808_BASE, 'http:g', 'http:g')
#self.checkJoin(RFC1808_BASE, 'http:', 'http:')
def
test_RFC2368
(
self
):
# Issue 11467: path that starts with a number is not parsed correctly
self
.
assertEqual
(
urllib
.
parse
.
urlparse
(
'mailto:1337@example.org'
),
(
'mailto'
,
''
,
'1337@example.org'
,
''
,
''
,
''
))
def
test_RFC2396
(
self
):
# cases from RFC 2396
...
...
Lib/urllib/parse.py
View file @
b4bd4af8
...
...
@@ -340,12 +340,17 @@ def urlsplit(url, scheme='', allow_fragments=True):
v
=
SplitResult
(
scheme
,
netloc
,
url
,
query
,
fragment
)
_parse_cache
[
key
]
=
v
return
_coerce_result
(
v
)
if
url
.
endswith
(
':'
)
or
not
url
[
i
+
1
].
isdigit
():
for
c
in
url
[:
i
]:
if
c
not
in
scheme_chars
:
break
else
:
for
c
in
url
[:
i
]:
if
c
not
in
scheme_chars
:
break
else
:
try
:
# make sure "url" is not actually a port number (in which case
# "scheme" is really part of the path
_testportnum
=
int
(
url
[
i
+
1
:])
except
ValueError
:
scheme
,
url
=
url
[:
i
].
lower
(),
url
[
i
+
1
:]
if
url
[:
2
]
==
'//'
:
netloc
,
url
=
_splitnetloc
(
url
,
2
)
if
((
'['
in
netloc
and
']'
not
in
netloc
)
or
...
...
Misc/NEWS
View file @
b4bd4af8
...
...
@@ -56,6 +56,9 @@ Core and Builtins
Library
-------
-
Issue
#
11467
:
Fix
urlparse
behavior
when
handling
urls
which
contains
scheme
specific
part
only
digits
.
Patch
by
Santoso
Wijaya
.
-
Issue
#
11474
:
Fix
the
bug
with
url2pathname
()
handling
of
'/C|/'
on
Windows
.
Patch
by
Santoso
Wijaya
.
...
...
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