Skip to content
Myr

cleanup #633

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 7813bd8 · Browse files · 1 file+4 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−9 removed

  • other:+4 added−9 removed

1 file+4 added−9 removed

modified:requests/utils.py+4 added-9 removed
405 unmodified lines
406 + "0123456789-._~")407408409def unquote_unreserved(uri):410 '''411 this try catch is a poor man's patch for issue #630412 https://github.com/kennethreitz/requests/issues/630413 '''410 """Un-escape any percent-escape sequences in a URI that are unreserved411 characters. This leaves all reserved, illegal and non-ASCII bytes encoded.412 """413 try:415 """Un-escape any percent-escape sequences in a URI that are unreserved416 characters.417 This leaves all reserved, illegal and non-ASCII bytes encoded.418 """414 parts = uri.split('%')415 for i in range(1, len(parts)):416 h = parts[i][0:2]417 if len(h) == 2:
4 unmodified lines
422 parts[i] = '%' + parts[i]423 else:424 parts[i] = '%' + parts[i]425 return ''.join(parts)431 except:426 except ValueError:427 return uri428429430def requote_uri(uri):
25 unmodified lines