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
|
@ -571,7 +571,7 @@ task isn't already covered by the URL parsing functions above.
|
|||
percent-encoded sequences into Unicode characters, as accepted by the
|
||||
:meth:`bytes.decode` method.
|
||||
|
||||
*string* must be a :class:`str`.
|
||||
*string* may be either a :class:`str` or a :class:`bytes`.
|
||||
|
||||
*encoding* defaults to ``'utf-8'``.
|
||||
*errors* defaults to ``'replace'``, meaning invalid sequences are replaced
|
||||
|
@ -579,6 +579,11 @@ task isn't already covered by the URL parsing functions above.
|
|||
|
||||
Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``.
|
||||
|
||||
.. versionchanged:: 3.9
|
||||
*string* parameter supports bytes and str objects (previously only str).
|
||||
|
||||
|
||||
|
||||
|
||||
.. function:: unquote_plus(string, encoding='utf-8', errors='replace')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue