We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac52107 commit 82a3f8aCopy full SHA for 82a3f8a
Lib/urllib/parse.py
@@ -314,7 +314,9 @@ def unquote_to_bytes(string):
314
"""unquote_to_bytes('abc%20def') -> b'abc def'."""
315
# Note: strings are encoded as UTF-8. This is only an issue if it contains
316
# unescaped non-ASCII characters, which URIs should not.
317
- if string in (b'', ''):
+ if not string:
318
+ # Is it a string-like object?
319
+ string.split
320
return b''
321
if isinstance(string, str):
322
string = string.encode('utf-8')
0 commit comments