From 63f9435ed22241f86dfe21cb17011c1102a846b6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 13 Jul 2025 18:22:26 +0300 Subject: [PATCH 1/2] Revert "gh-101100: Fix sphinx warnings in `library/email.parser.rst` (#136475)" This reverts commit 515b3d18edfce00ce441e0e41091d0dd57f201ad. --- Doc/library/email.parser.rst | 10 +++++----- Doc/tools/.nitignore | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst index 90796370ebb407..439b5c8f34b65a 100644 --- a/Doc/library/email.parser.rst +++ b/Doc/library/email.parser.rst @@ -48,8 +48,8 @@ methods. FeedParser API ^^^^^^^^^^^^^^ -The :class:`BytesFeedParser`, imported from the :mod:`email.parser.FeedParser` -module, provides an API that is conducive to incremental parsing of email messages, +The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` 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 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 @@ -116,7 +116,7 @@ Here is the API for the :class:`BytesFeedParser`: Works like :class:`BytesFeedParser` except that the input to the :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 - contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is + contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is ``True``, no binary attachments. .. 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 resulting bytes, and return the message object. *fp* must support - both the :meth:`~io.IOBase.readline` and the :meth:`~io.TextIOBase.read` + both the :meth:`~io.IOBase.readline` and the :meth:`~io.IOBase.read` methods. The bytes contained in *fp* must be formatted as a block of :rfc:`5322` - (or, if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`) + (or, if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`) style headers and header continuation lines, optionally preceded by an 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 diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 510225afab8933..31b2e567f11056 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -15,6 +15,7 @@ Doc/extending/extending.rst Doc/library/ast.rst Doc/library/asyncio-extending.rst Doc/library/email.charset.rst +Doc/library/email.parser.rst Doc/library/http.cookiejar.rst Doc/library/http.server.rst Doc/library/importlib.rst From 1ad4ec25759182f55299b8f6cac7f0ed6ea89eca Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 13 Jul 2025 18:38:15 +0300 Subject: [PATCH 2/2] Keep the email.policy.Policy -> email.policy.EmailPolicy changes --- Doc/library/email.parser.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst index 439b5c8f34b65a..6a70714dc3ee42 100644 --- a/Doc/library/email.parser.rst +++ b/Doc/library/email.parser.rst @@ -116,7 +116,7 @@ Here is the API for the :class:`BytesFeedParser`: Works like :class:`BytesFeedParser` except that the input to the :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 - 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. .. versionchanged:: 3.3 Added the *policy* keyword. @@ -159,7 +159,7 @@ message body, instead setting the payload to the raw body. methods. 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 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