From 0603c28ca120c2129d3b83a83e7964fdb7c424e2 Mon Sep 17 00:00:00 2001 From: lipengyu Date: Tue, 23 Jun 2026 14:34:05 +0800 Subject: [PATCH 1/3] update {charset,parser}.rst --- Doc/library/email.charset.rst | 4 ++-- Doc/library/email.parser.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/email.charset.rst b/Doc/library/email.charset.rst index 76a57031862c85b..3e8fc3b9601863a 100644 --- a/Doc/library/email.charset.rst +++ b/Doc/library/email.charset.rst @@ -183,8 +183,8 @@ new entries to the global character set, alias, and codec registries: Optional *output_charset* is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset - when the method :meth:`Charset.convert` is called. The default is to output in - the same character set as the input. + when the method :meth:`!Charset.convert` is called. The default is to output + in the same character set as the input. Both *input_charset* and *output_charset* must have Unicode codec entries in the module's character set-to-codec mapping; use :func:`add_codec` to add codecs the diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst index 6a67bf7c8e555dd..722a8b8fdb02c75 100644 --- a/Doc/library/email.parser.rst +++ b/Doc/library/email.parser.rst @@ -48,7 +48,7 @@ methods. FeedParser API ^^^^^^^^^^^^^^ -The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` module, +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 From be1878b3771c414024000e2e1f0cc01ed3e019ef Mon Sep 17 00:00:00 2001 From: lipengyu Date: Tue, 23 Jun 2026 14:54:04 +0800 Subject: [PATCH 2/3] Update .nitignore --- Doc/tools/.nitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 2255c745c003838..9a25d8d910a70a3 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -7,8 +7,6 @@ Doc/c-api/intro.rst Doc/c-api/stable.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 bccd971e968f767cac9a7ca4b66d3deda4c75a95 Mon Sep 17 00:00:00 2001 From: lipengyu Date: Tue, 23 Jun 2026 22:27:59 +0800 Subject: [PATCH 3/3] update --- Doc/library/email.charset.rst | 4 ++-- Doc/library/email.parser.rst | 4 ++-- Lib/email/charset.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/email.charset.rst b/Doc/library/email.charset.rst index 3e8fc3b9601863a..b0a9eeb65521d0f 100644 --- a/Doc/library/email.charset.rst +++ b/Doc/library/email.charset.rst @@ -183,8 +183,8 @@ new entries to the global character set, alias, and codec registries: Optional *output_charset* is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the output charset - when the method :meth:`!Charset.convert` is called. The default is to output - in the same character set as the input. + when the method :meth:`Charset.body_encode` is called. The default is to + output in the same character set as the input. Both *input_charset* and *output_charset* must have Unicode codec entries in the module's character set-to-codec mapping; use :func:`add_codec` to add codecs the diff --git a/Doc/library/email.parser.rst b/Doc/library/email.parser.rst index 722a8b8fdb02c75..0e6e4ceb64ed15f 100644 --- a/Doc/library/email.parser.rst +++ b/Doc/library/email.parser.rst @@ -86,7 +86,7 @@ Here is the API for the :class:`BytesFeedParser`: more information on what else *policy* controls, see the :mod:`~email.policy` documentation. - Note: **The policy keyword should always be specified**; The default will + Note: **The policy keyword should always be specified**. The default will change to :data:`email.policy.default` in a future version of Python. .. versionadded:: 3.2 @@ -142,7 +142,7 @@ message body, instead setting the payload to the raw body. arguments have the same meaning and semantics as the *_factory* and *policy* arguments of :class:`BytesFeedParser`. - Note: **The policy keyword should always be specified**; The default will + Note: **The policy keyword should always be specified**. The default will change to :data:`email.policy.default` in a future version of Python. .. versionchanged:: 3.3 diff --git a/Lib/email/charset.py b/Lib/email/charset.py index 5981791820e740c..9b1a731495f554c 100644 --- a/Lib/email/charset.py +++ b/Lib/email/charset.py @@ -151,7 +151,7 @@ def add_charset(charset, header_enc=None, body_enc=None, output_charset=None): Optional output_charset is the character set that the output should be in. Conversions will proceed from input charset, to Unicode, to the - output charset when the method Charset.convert() is called. The default + output charset when the method Charset.body_encode() is called. The default is to output in the same character set as the input. Both input_charset and output_charset must have Unicode codec entries in