Skip to content

Commit 25046ae

Browse files
Merge pull request #2 from rapidcow/patch-1
2 parents 982720c + 29cb612 commit 25046ae

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Doc/library/email.contentmanager.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,13 @@ Currently the email package provides only one concrete content manager,
156156
:exc:`ValueError`.
157157

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

194-
Note that this method will append a newline character to the end of strings,
195-
if it wasn't passed already. For example, the following are equivalent ::
196-
197-
msg = EmailMessage()
198-
msg.set_content("hello")
199-
msg.set_content("hello\n")
200-
201200

202201
.. rubric:: Footnotes
203202

0 commit comments

Comments
 (0)