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
ed1183db
Commit
ed1183db
authored
May 19, 2012
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Plain Diff
#14072: merge with 3.2.
parents
d527259f
6709b7d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
Lib/test/test_urlparse.py
Lib/test/test_urlparse.py
+7
-0
Lib/urllib/parse.py
Lib/urllib/parse.py
+6
-6
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urlparse.py
View file @
ed1183db
...
@@ -806,6 +806,13 @@ class UrlParseTestCase(unittest.TestCase):
...
@@ -806,6 +806,13 @@ class UrlParseTestCase(unittest.TestCase):
encoding
=
'utf-8'
)
encoding
=
'utf-8'
)
self
.
assertRaises
(
TypeError
,
urllib
.
parse
.
quote
,
b'foo'
,
errors
=
'strict'
)
self
.
assertRaises
(
TypeError
,
urllib
.
parse
.
quote
,
b'foo'
,
errors
=
'strict'
)
def
test_issue14072
(
self
):
p1
=
urllib
.
parse
.
urlsplit
(
'tel:+31-641044153'
)
self
.
assertEqual
(
p1
.
scheme
,
'tel'
)
self
.
assertEqual
(
p1
.
path
,
'+31-641044153'
)
p2
=
urllib
.
parse
.
urlsplit
(
'tel:+31641044153'
)
self
.
assertEqual
(
p2
.
scheme
,
'tel'
)
self
.
assertEqual
(
p2
.
path
,
'+31641044153'
)
def
test_main
():
def
test_main
():
support
.
run_unittest
(
UrlParseTestCase
)
support
.
run_unittest
(
UrlParseTestCase
)
...
...
Lib/urllib/parse.py
View file @
ed1183db
...
@@ -338,12 +338,12 @@ def urlsplit(url, scheme='', allow_fragments=True):
...
@@ -338,12 +338,12 @@ def urlsplit(url, scheme='', allow_fragments=True):
if
c
not
in
scheme_chars
:
if
c
not
in
scheme_chars
:
break
break
else
:
else
:
try
:
# make sure "url" is not actually a port number (in which case
# make sure "url" is not actually a port number (in which case
# "scheme" is really part of the path
# "scheme" is really part of the path)
_testportnum
=
int
(
url
[
i
+
1
:])
rest
=
url
[
i
+
1
:]
except
ValueError
:
if
not
rest
or
any
(
c
not
in
'0123456789'
for
c
in
rest
):
scheme
,
url
=
url
[:
i
].
lower
(),
url
[
i
+
1
:]
# not a port number
scheme
,
url
=
url
[:
i
].
lower
(),
rest
if
url
[:
2
]
==
'//'
:
if
url
[:
2
]
==
'//'
:
netloc
,
url
=
_splitnetloc
(
url
,
2
)
netloc
,
url
=
_splitnetloc
(
url
,
2
)
...
...
Misc/NEWS
View file @
ed1183db
...
@@ -44,6 +44,9 @@ Library
...
@@ -44,6 +44,9 @@ Library
- Issue #14721: Send the correct '
Content
-
length
:
0
' header when the body is an
- Issue #14721: Send the correct '
Content
-
length
:
0
' header when the body is an
empty string ''. Initial Patch contributed by Arve Knudsen.
empty string ''. Initial Patch contributed by Arve Knudsen.
- Issue #14072: Fix parsing of '
tel
' URIs in urlparse by making the check for
ports stricter.
- Issue #9374: Generic parsing of query and fragment portions of url for any
- Issue #9374: Generic parsing of query and fragment portions of url for any
scheme. Supported both by RFC3986 and RFC2396.
scheme. Supported both by RFC3986 and RFC2396.
...
...
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