Skip to content

Commit 7c0a227

Browse files
committed
What's new entry for email 5.1.
1 parent d793109 commit 7c0a227

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

Doc/library/email.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ version 5.0:
118118
convert message bodies that have a :mailheader:`Content-Transfer-Encoding` of
119119
8bit to instead have a 7bit Content-Transfer-Encoding.
120120

121-
* New function :class:`~email.generator.BytesGenerator` produces bytes
121+
* New class :class:`~email.generator.BytesGenerator` produces bytes
122122
as output, preserving any unchanged non-ASCII data that was
123123
present in the input used to build the model, including message bodies
124124
with a :mailheader:`Content-Transfer-Encoding` of 8bit.

Doc/whatsnew/3.2.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,34 @@ module::
184184
PEP written by Barry Warsaw.
185185

186186

187+
Email 5.1
188+
=========
189+
190+
The email package is extended to be able to parse and generate email messages
191+
in bytes format.
192+
193+
* New functions :func:`~email.message_from_bytes` and
194+
:func:`~email.message_from_binary_file`, and new classes
195+
:class:`~email.parser.BytesFeedParser` and :class:`~email.parser.BytesParser`
196+
allow binary message data to be parsed into model objects.
197+
198+
* Given bytes input to the model, :meth:`~email.message.Message.get_payload`
199+
will by default decode a message body that has a
200+
:mailheader:`Content-Transfer-Encoding` of `8bit` using the charset specified
201+
in the MIME headers and return the resulting string.
202+
203+
* Given bytes input to the model, :class:`~email.generator.Generator` will
204+
convert message bodies that have a :mailheader:`Content-Transfer-Encoding` of
205+
8bit to instead have a 7bit Content-Transfer-Encoding.
206+
207+
* New class :class:`~email.generator.BytesGenerator` produces bytes
208+
as output, preserving any unchanged non-ASCII data that was
209+
present in the input used to build the model, including message bodies
210+
with a :mailheader:`Content-Transfer-Encoding` of 8bit.
211+
212+
(Proposed and implemented by R. David Murray, :issue:`4661`.)
213+
214+
187215
Other Language Changes
188216
======================
189217

0 commit comments

Comments
 (0)