Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.13] gh-121542: Document trailing newline behavior in set_content() (GH-121543) #128995

Merged
merged 1 commit into from
Jan 18, 2025
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
8 changes: 7 additions & 1 deletion Doc/library/email.contentmanager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,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
Loading