Skip to content

Commit df9e752

Browse files
author
Marcin Kościelnicki
committed
Pass str/bytes instead of unicode/str to urllib.quote
On Python 2, passing unicode as the second argument to urllib.quote is a very bad idea - http://bugs.python.org/issue23885 On Python 3, both b'' and '' are fine.
1 parent 9895b76 commit df9e752

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oauth2_provider/oauth2_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _get_escaped_full_path(self, request):
2626
parsed = list(urlparse(request.get_full_path()))
2727
unsafe = set(c for c in parsed[4]).difference(urlencoded)
2828
for c in unsafe:
29-
parsed[4] = parsed[4].replace(c, quote(c, safe=''))
29+
parsed[4] = parsed[4].replace(c, quote(c, safe=b''))
3030

3131
return urlunparse(parsed)
3232

0 commit comments

Comments
 (0)