@@ -156,7 +156,13 @@ Currently the email package provides only one concrete content manager,
156
156
:exc: `ValueError `.
157
157
158
158
* 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.
160
166
* For :class: `~email.message.EmailMessage `, per :rfc: `2046 `, raise
161
167
an error if a *cte * of ``quoted-printable `` or ``base64 `` is
162
168
requested for *subtype * ``rfc822 ``, and for any *cte * other than
@@ -191,13 +197,6 @@ Currently the email package provides only one concrete content manager,
191
197
(distinguished from strings by having a ``name `` attribute), add the
192
198
headers to *msg *.
193
199
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
-
201
200
202
201
.. rubric :: Footnotes
203
202
0 commit comments