diff options
author | Stein Karlsen <karlsen.stein@gmail.com> | 2019-10-14 10:36:29 (GMT) |
---|---|---|
committer | Tal Einat <taleinat+github@gmail.com> | 2019-10-14 10:36:29 (GMT) |
commit | aad2ee01561f260c69af1951c0d6fcaf75c4d41b (patch) | |
tree | 6ffb53582b94065c4eb04012aaffa49a1af5422f /Lib/urllib/parse.py | |
parent | 9cb51f4e20033f5fd4fed46036e347f263bb6d5b (diff) | |
download | cpython-aad2ee01561f260c69af1951c0d6fcaf75c4d41b.zip cpython-aad2ee01561f260c69af1951c0d6fcaf75c4d41b.tar.gz cpython-aad2ee01561f260c69af1951c0d6fcaf75c4d41b.tar.bz2 |
bpo-32498: urllib.parse.unquote also accepts bytes (GH-7768)
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r-- | Lib/urllib/parse.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index b660878..3a38dc1 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -631,6 +631,8 @@ def unquote(string, encoding='utf-8', errors='replace'): unquote('abc%20def') -> 'abc def'. """ + if isinstance(string, bytes): + return unquote_to_bytes(string).decode(encoding, errors) if '%' not in string: string.split return string |