Skip to content

Commit 8ba41c1

Browse files
committed
gh-130578: clarify urllib.parse.quote parameter defaults behavior
1 parent 9e474a9 commit 8ba41c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/urllib.parse.rst

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

639639
The optional *encoding* and *errors* parameters specify how to deal with
640640
non-ASCII characters, as accepted by the :meth:`str.encode` method.
641-
*encoding* defaults to ``'utf-8'``.
642-
*errors* defaults to ``'strict'``, meaning unsupported characters raise a
641+
Although these parameters default to ``None`` in the function signature,
642+
when processing :class:`str` inputs, *encoding* effectively defaults to ``'utf-8'``
643+
and *errors* to ``'strict'``, meaning unsupported characters raise a
643644
:class:`UnicodeEncodeError`.
644645
*encoding* and *errors* must not be supplied if *string* is a
645646
:class:`bytes`, or a :class:`TypeError` is raised.

0 commit comments

Comments
 (0)