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
e127e243
Commit
e127e243
authored
May 17, 2010
by
Florent Xicluna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slight style cleanup.
parent
422545f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
Lib/urllib.py
Lib/urllib.py
+6
-8
No files found.
Lib/urllib.py
View file @
e127e243
...
...
@@ -765,7 +765,7 @@ class FancyURLopener(URLopener):
else
:
return
self
.
open
(
newurl
,
data
)
def
get_user_passwd
(
self
,
host
,
realm
,
clear_cache
=
0
):
def
get_user_passwd
(
self
,
host
,
realm
,
clear_cache
=
0
):
key
=
realm
+
'@'
+
host
.
lower
()
if
key
in
self
.
auth_cache
:
if
clear_cache
:
...
...
@@ -1157,7 +1157,8 @@ def splitvalue(attr):
return
attr
,
None
_hexdig
=
'0123456789ABCDEFabcdef'
_hextochr
=
dict
((
a
+
b
,
chr
(
int
(
a
+
b
,
16
)))
for
a
in
_hexdig
for
b
in
_hexdig
)
_hextochr
=
dict
((
a
+
b
,
chr
(
int
(
a
+
b
,
16
)))
for
a
in
_hexdig
for
b
in
_hexdig
)
def
unquote
(
s
):
"""unquote('abc%20def') -> 'abc def'."""
...
...
@@ -1182,7 +1183,7 @@ always_safe = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
'0123456789'
'_.-'
)
_safemaps
=
{}
def
quote
(
s
,
safe
=
'/'
):
def
quote
(
s
,
safe
=
'/'
):
"""quote('abc def') -> 'abc%20def'
Each part of a URL, e.g. the path info, the query, etc., has a
...
...
@@ -1216,14 +1217,14 @@ def quote(s, safe = '/'):
res
=
map
(
safe_map
.
__getitem__
,
s
)
return
''
.
join
(
res
)
def
quote_plus
(
s
,
safe
=
''
):
def
quote_plus
(
s
,
safe
=
''
):
"""Quote the query fragment of a URL; replacing ' ' with '+'"""
if
' '
in
s
:
s
=
quote
(
s
,
safe
+
' '
)
return
s
.
replace
(
' '
,
'+'
)
return
quote
(
s
,
safe
)
def
urlencode
(
query
,
doseq
=
0
):
def
urlencode
(
query
,
doseq
=
0
):
"""Encode a sequence of two-element tuples or dictionary into a URL query string.
If any values in the query arg are sequences and doseq is true, each
...
...
@@ -1380,7 +1381,6 @@ if sys.platform == 'darwin':
return
False
def
getproxies_macosx_sysconf
():
"""Return a dictionary of scheme -> proxy server URL mappings.
...
...
@@ -1389,8 +1389,6 @@ if sys.platform == 'darwin':
"""
return
_get_proxies
()
def
proxy_bypass
(
host
):
if
getproxies_environment
():
return
proxy_bypass_environment
(
host
)
...
...
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