[3.13] gh-101100: Fix sphinx warnings in library/email.parser.rst (GH-136475) (#136533)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-07-11 11:43:52 +02:00 committed by GitHub
parent aa3c6421ef
commit aa4bb1c685
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View file

@ -48,8 +48,8 @@ methods.
FeedParser API FeedParser API
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` module, The :class:`BytesFeedParser`, imported from the :mod:`email.parser.FeedParser`
provides an API that is conducive to incremental parsing of email messages, module, provides an API that is conducive to incremental parsing of email messages,
such as would be necessary when reading the text of an email message from a such as would be necessary when reading the text of an email message from a
source that can block (such as a socket). The :class:`BytesFeedParser` can of source that can block (such as a socket). The :class:`BytesFeedParser` can of
course be used to parse an email message fully contained in a :term:`bytes-like course be used to parse an email message fully contained in a :term:`bytes-like
@ -116,7 +116,7 @@ Here is the API for the :class:`BytesFeedParser`:
Works like :class:`BytesFeedParser` except that the input to the Works like :class:`BytesFeedParser` except that the input to the
:meth:`~BytesFeedParser.feed` method must be a string. This is of limited :meth:`~BytesFeedParser.feed` method must be a string. This is of limited
utility, since the only way for such a message to be valid is for it to utility, since the only way for such a message to be valid is for it to
contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is
``True``, no binary attachments. ``True``, no binary attachments.
.. versionchanged:: 3.3 Added the *policy* keyword. .. versionchanged:: 3.3 Added the *policy* keyword.
@ -155,11 +155,11 @@ message body, instead setting the payload to the raw body.
Read all the data from the binary file-like object *fp*, parse the Read all the data from the binary file-like object *fp*, parse the
resulting bytes, and return the message object. *fp* must support resulting bytes, and return the message object. *fp* must support
both the :meth:`~io.IOBase.readline` and the :meth:`~io.IOBase.read` both the :meth:`~io.IOBase.readline` and the :meth:`~io.TextIOBase.read`
methods. methods.
The bytes contained in *fp* must be formatted as a block of :rfc:`5322` The bytes contained in *fp* must be formatted as a block of :rfc:`5322`
(or, if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`) (or, if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`)
style headers and header continuation lines, optionally preceded by an style headers and header continuation lines, optionally preceded by an
envelope header. The header block is terminated either by the end of the envelope header. The header block is terminated either by the end of the
data or by a blank line. Following the header block is the body of the data or by a blank line. Following the header block is the body of the

View file

@ -16,7 +16,6 @@ Doc/library/ast.rst
Doc/library/asyncio-extending.rst Doc/library/asyncio-extending.rst
Doc/library/asyncio-policy.rst Doc/library/asyncio-policy.rst
Doc/library/email.charset.rst Doc/library/email.charset.rst
Doc/library/email.parser.rst
Doc/library/functools.rst Doc/library/functools.rst
Doc/library/http.cookiejar.rst Doc/library/http.cookiejar.rst
Doc/library/http.server.rst Doc/library/http.server.rst