summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-08-31 15:48:10 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-08-31 15:48:10 (GMT)
commit6102e29df28fa0707752875e23445ef1d84d5b10 (patch)
tree00cf5661ca3c395788a8ffad2c21b6bdef1a385a /Lib/urllib.py
parent7e861bd1b39e3a0f60e39e12483754558562cf07 (diff)
downloadcpython-6102e29df28fa0707752875e23445ef1d84d5b10.zip
cpython-6102e29df28fa0707752875e23445ef1d84d5b10.tar.gz
cpython-6102e29df28fa0707752875e23445ef1d84d5b10.tar.bz2
fixes bug #111951
applies patch #101369 by Moshe Zadke use explicit list of always safe characters instead of string.letters add test case
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 2c6d878..4492e99 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -1011,7 +1011,9 @@ def unquote_plus(s):
s = string.join(string.split(s, '+'), ' ')
return unquote(s)
-always_safe = string.letters + string.digits + '_,.-'
+always_safe = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ 'abcdefghijklmnopqrstuvwxyz'
+ '0123456789' '_,.-')
def quote(s, safe = '/'):
"""quote('abc def') -> 'abc%20def'."""
# XXX Can speed this up an order of magnitude
@@ -1043,7 +1045,6 @@ def urlencode(dict):
l.append(k + '=' + v)
return string.join(l, '&')
-
# Proxy handling
def getproxies_environment():
"""Return a dictionary of scheme -> proxy server URL mappings.