Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b7ddcc3

Browse filesBrowse files
miss-islingtonZeroIntensityrapidcow
authored
[3.13] gh-121542: Document trailing newline behavior in set_content() (GH-121543) (#128995)
gh-121542: Document trailing newline behavior in `set_content()` (GH-121543) (cherry picked from commit fba475a) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Yizheng Meng <dev@rapidcow.org>
1 parent fdac362 commit b7ddcc3
Copy full SHA for b7ddcc3

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎Doc/library/email.contentmanager.rst

Copy file name to clipboardExpand all lines: Doc/library/email.contentmanager.rst
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ Currently the email package provides only one concrete content manager,
157157
:exc:`ValueError`.
158158

159159
* For ``str`` objects, if *cte* is not set use heuristics to
160-
determine the most compact encoding.
160+
determine the most compact encoding. Prior to encoding,
161+
:meth:`str.splitlines` is used to normalize all line boundaries,
162+
ensuring that each line of the payload is terminated by the
163+
current policy's :data:`~email.policy.Policy.linesep` property
164+
(even if the original string did not end with one).
165+
* For ``bytes`` objects, *cte* is taken to be base64 if not set,
166+
and the aforementioned newline translation is not performed.
161167
* For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise
162168
an error if a *cte* of ``quoted-printable`` or ``base64`` is
163169
requested for *subtype* ``rfc822``, and for any *cte* other than

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.