Skip to content

Commit 1f1ec04

Browse files
committed
merge heads
2 parents dd35162 + 14b0124 commit 1f1ec04

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Doc/library/email.mime.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,15 @@ Here are the classes:
185185
minor type and defaults to :mimetype:`plain`. *_charset* is the character
186186
set of the text and is passed as a parameter to the
187187
:class:`~email.mime.nonmultipart.MIMENonMultipart` constructor; it defaults
188-
to ``us-ascii``. No guessing or encoding is performed on the text data.
188+
to ``us-ascii``.
189+
190+
Unless the ``_charset`` parameter is explicitly set to ``None``, the
191+
MIMEText object created will have both a :mailheader:`Content-Type` header
192+
with a ``charset`` parameter, and a :mailheader:`Content-Transfer-Endcoding`
193+
header. This means that a subsequent ``set_payload`` call will not result
194+
in an encoded payload, even if a charset is passed in the ``set_payload``
195+
command. You can "reset" this behavior by deleting the
196+
``Content-Transfer-Encoding`` header, after which a ``set_payload`` call
197+
will automatically encode the new payload (and add a new
198+
:mailheader:`Content-Transfer-Encoding` header).
189199

0 commit comments

Comments
 (0)