Skip to content

Commit bc9bb73

Browse files
gh-130578: clarify urllib.parse.quote parameter defaults behavior (#130598)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 6d38668 commit bc9bb73

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)