Skip to content

Commit 069ed2a

Browse files
miss-islingtonMr-Sunglassesserhiy-storchaka
authored
[3.15] gh-130578: clarify urllib.parse.quote parameter defaults behavior (GH-130598) (#153383)
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 9fb25cb commit 069ed2a

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

650650
The optional *encoding* and *errors* parameters specify how to deal with
651651
non-ASCII characters, as accepted by the :meth:`str.encode` method.
652-
*encoding* defaults to ``'utf-8'``.
653-
*errors* defaults to ``'strict'``, meaning unsupported characters raise a
652+
Although these parameters default to ``None`` in the function signature,
653+
when processing :class:`str` inputs, *encoding* effectively defaults to ``'utf-8'``
654+
and *errors* to ``'strict'``, meaning unsupported characters raise a
654655
:class:`UnicodeEncodeError`.
655656
*encoding* and *errors* must not be supplied if *string* is a
656657
:class:`bytes`, or a :class:`TypeError` is raised.

0 commit comments

Comments
 (0)