Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e27a7b8

Browse files
committed
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.
1 parent e1bb5f9 commit e27a7b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/urllib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ def _fast_quote(s):
10491049
for i in range(len(res)):
10501050
c = res[i]
10511051
if not _fast_safe.has_key(c):
1052-
res[i] = '%%%02x' % ord(c)
1052+
res[i] = '%%%02X' % ord(c)
10531053
return ''.join(res)
10541054

10551055
def quote(s, safe = '/'):
@@ -1080,7 +1080,7 @@ def quote(s, safe = '/'):
10801080
for i in range(len(res)):
10811081
c = res[i]
10821082
if c not in safe:
1083-
res[i] = '%%%02x' % ord(c)
1083+
res[i] = '%%%02X' % ord(c)
10841084
return ''.join(res)
10851085

10861086
def quote_plus(s, safe = ''):

0 commit comments

Comments
 (0)