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
4722da6e
Commit
4722da6e
authored
Aug 25, 1998
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo in keyword argument 'allow_frament' should be 'allow_fragment'
parent
afd3daed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Lib/urlparse.py
Lib/urlparse.py
+6
-6
No files found.
Lib/urlparse.py
View file @
4722da6e
...
@@ -43,8 +43,8 @@ def clear_cache():
...
@@ -43,8 +43,8 @@ def clear_cache():
# Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
# Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
# Note that we don't break the components up in smaller bits
# Note that we don't break the components up in smaller bits
# (e.g. netloc is a single string) and we don't expand % escapes.
# (e.g. netloc is a single string) and we don't expand % escapes.
def
urlparse
(
url
,
scheme
=
''
,
allow_framents
=
1
):
def
urlparse
(
url
,
scheme
=
''
,
allow_fra
g
ments
=
1
):
key
=
url
,
scheme
,
allow_framents
key
=
url
,
scheme
,
allow_fra
g
ments
try
:
try
:
return
_parse_cache
[
key
]
return
_parse_cache
[
key
]
except
KeyError
:
except
KeyError
:
...
@@ -65,7 +65,7 @@ def urlparse(url, scheme = '', allow_framents = 1):
...
@@ -65,7 +65,7 @@ def urlparse(url, scheme = '', allow_framents = 1):
if
i
<
0
:
if
i
<
0
:
i
=
len
(
url
)
i
=
len
(
url
)
netloc
,
url
=
url
[
2
:
i
],
url
[
i
:]
netloc
,
url
=
url
[
2
:
i
],
url
[
i
:]
if
allow_framents
and
scheme
in
uses_fragment
:
if
allow_fra
g
ments
and
scheme
in
uses_fragment
:
i
=
string
.
rfind
(
url
,
'#'
)
i
=
string
.
rfind
(
url
,
'#'
)
if
i
>=
0
:
if
i
>=
0
:
url
,
fragment
=
url
[:
i
],
url
[
i
+
1
:]
url
,
fragment
=
url
[:
i
],
url
[
i
+
1
:]
...
@@ -101,13 +101,13 @@ def urlunparse((scheme, netloc, url, params, query, fragment)):
...
@@ -101,13 +101,13 @@ def urlunparse((scheme, netloc, url, params, query, fragment)):
# Join a base URL and a possibly relative URL to form an absolute
# Join a base URL and a possibly relative URL to form an absolute
# interpretation of the latter.
# interpretation of the latter.
def
urljoin
(
base
,
url
,
allow_framents
=
1
):
def
urljoin
(
base
,
url
,
allow_fra
g
ments
=
1
):
if
not
base
:
if
not
base
:
return
url
return
url
bscheme
,
bnetloc
,
bpath
,
bparams
,
bquery
,
bfragment
=
\
bscheme
,
bnetloc
,
bpath
,
bparams
,
bquery
,
bfragment
=
\
urlparse
(
base
,
''
,
allow_framents
)
urlparse
(
base
,
''
,
allow_fra
g
ments
)
scheme
,
netloc
,
path
,
params
,
query
,
fragment
=
\
scheme
,
netloc
,
path
,
params
,
query
,
fragment
=
\
urlparse
(
url
,
bscheme
,
allow_framents
)
urlparse
(
url
,
bscheme
,
allow_fra
g
ments
)
# XXX Unofficial hack: default netloc to bnetloc even if
# XXX Unofficial hack: default netloc to bnetloc even if
# schemes differ
# schemes differ
if
scheme
!=
bscheme
and
not
netloc
and
\
if
scheme
!=
bscheme
and
not
netloc
and
\
...
...
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