Skip to content

Commit 63d2ecf

Browse files
miss-islingtonMr-Sunglassesserhiy-storchaka
authored
[3.14] gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598) (#153384)
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 c323ea7 commit 63d2ecf

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
@@ -597,8 +597,9 @@ task isn't already covered by the URL parsing functions above.
597597

598598
The optional *encoding* and *errors* parameters specify how to deal with
599599
non-ASCII characters, as accepted by the :meth:`str.encode` method.
600-
*encoding* defaults to ``'utf-8'``.
601-
*errors* defaults to ``'strict'``, meaning unsupported characters raise a
600+
Although these parameters default to ``None`` in the function signature,
601+
when processing :class:`str` inputs, *encoding* effectively defaults to ``'utf-8'``
602+
and *errors* to ``'strict'``, meaning unsupported characters raise a
602603
:class:`UnicodeEncodeError`.
603604
*encoding* and *errors* must not be supplied if *string* is a
604605
:class:`bytes`, or a :class:`TypeError` is raised.

0 commit comments

Comments
 (0)