Skip to content

Commit 65677e6

Browse files
Mr-Sunglassesserhiy-storchaka
authored andcommitted
gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598)
(cherry picked from commit bc9bb73) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent ff3fca1 commit 65677e6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/library/urllib.parse.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,9 @@ task isn't already covered by the URL parsing functions above.
593593

594594
The optional *encoding* and *errors* parameters specify how to deal with
595595
non-ASCII characters, as accepted by the :meth:`str.encode` method.
596-
*encoding* defaults to ``'utf-8'``.
597-
*errors* defaults to ``'strict'``, meaning unsupported characters raise a
596+
Although these parameters default to ``None`` in the function signature,
597+
when processing :class:`str` inputs, *encoding* effectively defaults to ``'utf-8'``
598+
and *errors* to ``'strict'``, meaning unsupported characters raise a
598599
:class:`UnicodeEncodeError`.
599600
*encoding* and *errors* must not be supplied if *string* is a
600601
:class:`bytes`, or a :class:`TypeError` is raised.

0 commit comments

Comments
 (0)