mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Corrected version of 1.170
This commit is contained in:
parent
2bdec7bfb0
commit
cf6b6326e5
1 changed files with 3 additions and 6 deletions
|
|
@ -1110,12 +1110,9 @@ def quote(s, safe = '/'):
|
||||||
def quote_plus(s, safe = ''):
|
def quote_plus(s, safe = ''):
|
||||||
"""Quote the query fragment of a URL; replacing ' ' with '+'"""
|
"""Quote the query fragment of a URL; replacing ' ' with '+'"""
|
||||||
if ' ' in s:
|
if ' ' in s:
|
||||||
l = s.split(' ')
|
s = quote(s, safe + ' ')
|
||||||
for i in range(len(l)):
|
return s.replace(' ', '+')
|
||||||
l[i] = quote(l[i], safe)
|
return quote(s, safe)
|
||||||
return '+'.join(l)
|
|
||||||
else:
|
|
||||||
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.
|
"""Encode a sequence of two-element tuples or dictionary into a URL query string.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue