applies patch #101369 by Moshe Zadke
use explicit list of always safe characters instead of string.letters
add test case
This commit is contained in:
Jeremy Hylton 2000-08-31 15:48:10 +00:00
parent 7e861bd1b3
commit 6102e29df2
3 changed files with 18 additions and 2 deletions

View file

@ -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.