mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-32498: urllib.parse.unquote also accepts bytes (GH-7768)
This commit is contained in:
parent
9cb51f4e20
commit
aad2ee0156
4 changed files with 33 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue