]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 9 Jul 2026 05:18:34 +0000 (07:18 +0200)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2026 05:18:34 +0000 (05:18 +0000)
gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598)
(cherry picked from commit bc9bb7386597e22693662f489a7474998788e228)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/library/urllib.parse.rst

index 752837593c7ca6665621a3828b06a95c16e59bd1..e501c6b29b2652470f19261d0a47de4c12faa3ac 100644 (file)
@@ -593,8 +593,9 @@ task isn't already covered by the URL parsing functions above.
 
    The optional *encoding* and *errors* parameters specify how to deal with
    non-ASCII characters, as accepted by the :meth:`str.encode` method.
-   *encoding* defaults to ``'utf-8'``.
-   *errors* defaults to ``'strict'``, meaning unsupported characters raise a
+   Although these parameters default to ``None`` in the function signature,
+   when processing :class:`str` inputs, *encoding* effectively defaults to ``'utf-8'``
+   and *errors* to ``'strict'``, meaning unsupported characters raise a
    :class:`UnicodeEncodeError`.
    *encoding* and *errors* must not be supplied if *string* is a
    :class:`bytes`, or a :class:`TypeError` is raised.