mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
fixes bug #111951
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:
parent
7e861bd1b3
commit
6102e29df2
3 changed files with 18 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue