Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions Doc/library/email.contentmanager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ Currently the email package provides only one concrete content manager,
:exc:`ValueError`.

* For ``str`` objects, if *cte* is not set use heuristics to
determine the most compact encoding.
determine the most compact encoding. Prior to encoding,
:meth:`str.splitlines` is used to normalize all line boundaries,
ensuring that each line of the payload is terminated by the
current policy's :data:`~email.policy.Policy.linesep` property
(even if the original string did not end with one).
* For ``bytes`` objects, *cte* is taken to be base64 if not set,
and the aforementioned newline translation is not performed.
* For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise
an error if a *cte* of ``quoted-printable`` or ``base64`` is
requested for *subtype* ``rfc822``, and for any *cte* other than
Expand Down Expand Up @@ -191,13 +197,6 @@ Currently the email package provides only one concrete content manager,
(distinguished from strings by having a ``name`` attribute), add the
headers to *msg*.

Note that this method will append a newline character to the end of strings,
if it wasn't passed already. For example, the following are equivalent ::

msg = EmailMessage()
msg.set_content("hello")
msg.set_content("hello\n")


.. rubric:: Footnotes

Expand Down