FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-125188: Improve explanation of errors argument in urllib.parse by CaQtiml · Pull Request #158915 · python/cpython · GitHub

Repository navigation

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 8 additions & 4 deletions Doc/library/urllib.parse.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ or on combining URL components into a URL string.

The optional *encoding* and *errors* parameters specify how to decode
percent-encoded sequences into Unicode characters, as accepted by the
:meth:`bytes.decode` method.
:meth:`bytes.decode` method. See :func:`quote` for more about the
*encoding* and *errors* arguments.

The optional argument *max_num_fields* is the maximum number of fields to
read. If set, then throws a :exc:`ValueError` if there are more than
Expand Down Expand Up @@ -296,7 +297,8 @@ or on combining URL components into a URL string.

The optional *encoding* and *errors* parameters specify how to decode
percent-encoded sequences into Unicode characters, as accepted by the
:meth:`bytes.decode` method.
:meth:`bytes.decode` method. See :func:`quote` for more about the
*encoding* and *errors* arguments.

The optional argument *max_num_fields* is the maximum number of fields to
read. If set, then throws a :exc:`ValueError` if there are more than
Expand Down Expand Up @@ -652,7 +654,8 @@ task isn't already covered by the URL parsing functions above.
Although these parameters default to ``None`` in the function signature,
when processing :class:`str` inputs, *encoding* effectively defaults to ``'utf-8'``
and *errors* to ``'strict'``, meaning unsupported characters raise a
:class:`UnicodeEncodeError`.
:class:`UnicodeEncodeError`. See :ref:`standard-encodings` and
:ref:`error-handlers` for the values that *encoding* and *errors* can take.
*encoding* and *errors* must not be supplied if *string* is a
:class:`bytes`, or a :class:`TypeError` is raised.

Expand Down Expand Up @@ -692,7 +695,8 @@ task isn't already covered by the URL parsing functions above.

*encoding* defaults to ``'utf-8'``.
*errors* defaults to ``'replace'``, meaning invalid sequences are replaced
by a placeholder character.
by a placeholder character. See :func:`quote` for more about the
*encoding* and *errors* arguments.

Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``.

Expand Down
Loading

Back | FazBrowse Home | New Git URL