Commit e27a7b80 authored by Guido van Rossum's avatar Guido van Rossum

Anonymous SF bug 129288: "The python 2.0 urllib has %%%x as a format

when quoting forbidden characters. There are scripts out there that
break with lower case, therefore I guess %%%X should be used."

I agree, so am fixing this.
parent e1bb5f98
...@@ -1049,7 +1049,7 @@ def _fast_quote(s): ...@@ -1049,7 +1049,7 @@ def _fast_quote(s):
for i in range(len(res)): for i in range(len(res)):
c = res[i] c = res[i]
if not _fast_safe.has_key(c): if not _fast_safe.has_key(c):
res[i] = '%%%02x' % ord(c) res[i] = '%%%02X' % ord(c)
return ''.join(res) return ''.join(res)
def quote(s, safe = '/'): def quote(s, safe = '/'):
...@@ -1080,7 +1080,7 @@ def quote(s, safe = '/'): ...@@ -1080,7 +1080,7 @@ def quote(s, safe = '/'):
for i in range(len(res)): for i in range(len(res)):
c = res[i] c = res[i]
if c not in safe: if c not in safe:
res[i] = '%%%02x' % ord(c) res[i] = '%%%02X' % ord(c)
return ''.join(res) return ''.join(res)
def quote_plus(s, safe = ''): def quote_plus(s, safe = ''):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment