mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
cleanup #633
This commit is contained in:
+4
-9
@@ -407,15 +407,10 @@ UNRESERVED_SET = frozenset(
|
||||
|
||||
|
||||
def unquote_unreserved(uri):
|
||||
'''
|
||||
this try catch is a poor man's patch for issue #630
|
||||
https://github.com/kennethreitz/requests/issues/630
|
||||
'''
|
||||
"""Un-escape any percent-escape sequences in a URI that are unreserved
|
||||
characters. This leaves all reserved, illegal and non-ASCII bytes encoded.
|
||||
"""
|
||||
try:
|
||||
"""Un-escape any percent-escape sequences in a URI that are unreserved
|
||||
characters.
|
||||
This leaves all reserved, illegal and non-ASCII bytes encoded.
|
||||
"""
|
||||
parts = uri.split('%')
|
||||
for i in range(1, len(parts)):
|
||||
h = parts[i][0:2]
|
||||
@@ -428,7 +423,7 @@ def unquote_unreserved(uri):
|
||||
else:
|
||||
parts[i] = '%' + parts[i]
|
||||
return ''.join(parts)
|
||||
except:
|
||||
except ValueError:
|
||||
return uri
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user