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
6e3e6e0d
Commit
6e3e6e0d
authored
Jan 06, 2008
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forgot to backport the rest of #1637.
parent
81728cf4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
Lib/urlparse.py
Lib/urlparse.py
+6
-7
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/urlparse.py
View file @
6e3e6e0d
...
...
@@ -169,13 +169,12 @@ def _splitparams(url):
return
url
[:
i
],
url
[
i
+
1
:]
def
_splitnetloc
(
url
,
start
=
0
):
for
c
in
'/?#'
:
# the order is important!
delim
=
url
.
find
(
c
,
start
)
if
delim
>=
0
:
break
else
:
delim
=
len
(
url
)
return
url
[
start
:
delim
],
url
[
delim
:]
delim
=
len
(
url
)
# position of end of domain part of url, default is end
for
c
in
'/?#'
:
# look for delimiters; the order is NOT important
wdelim
=
url
.
find
(
c
,
start
)
# find first of this delim
if
wdelim
>=
0
:
# if found
delim
=
min
(
delim
,
wdelim
)
# use earliest delim position
return
url
[
start
:
delim
],
url
[
delim
:]
# return (domain, rest)
def
urlsplit
(
url
,
scheme
=
''
,
allow_fragments
=
True
):
"""Parse a URL into 5 components:
...
...
Misc/NEWS
View file @
6e3e6e0d
...
...
@@ -53,6 +53,8 @@ Core and builtins
Library
-------
- Patch #1637: fix urlparse for URLs like '
http
://
x
.
com
?
arg
=/
foo
'.
- Issue #1735: TarFile.extractall() now correctly sets directory permissions
and times.
...
...
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