Skip to content

Commit decab66

Browse files
committed
fix for that @chunk bug
1 parent 7dd5bd9 commit decab66

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/core/convert.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import sha
1515

1616
import pickle
17+
import re
1718
import sys
1819
import string
1920
import struct
@@ -97,6 +98,11 @@ def urlencode(value, safe="%&=", convall=False, limit=False):
9798
if convall or safe is None:
9899
safe = ""
99100

101+
# corner case when character % really needs to be
102+
# encoded (when not representing url encoded char)
103+
if all(map(lambda x: '%' in x, [safe, value])):
104+
value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value, re.DOTALL | re.IGNORECASE)
105+
100106
while True:
101107
result = urllib.quote(utf8encode(value), safe)
102108

0 commit comments

Comments
 (0)