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

gh-118455: Fix mangle_from_ default value in email.policy.Policy.__doc__ #118456

Merged
merged 2 commits into from May 5, 2024

Conversation

wimglenn
Copy link
Contributor

@wimglenn wimglenn commented May 1, 2024

The docstring says it defaults to True, but it actually defaults to False. Only the Compat32 subclass overrides that, if I understand correctly (cc @bitdancer ).

The docstring says it defaults to True, but it actually defaults
to False. Only the Compat32 subclass overrides that.
@@ -0,0 +1 @@
Correct default value of mangle_from\_ in email.policy.Policy docstring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need NEWS for a doc-only change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, but the CI fails without that and I don't have permission to add labels 🤷

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mangle_from_ is documented to be:

   If optional *mangle_from_* is ``True``, put a ``>`` character in front of
   any line in the body that starts with the exact string ``"From "``, that is
   ``From`` followed by a space at the beginning of a line.  *mangle_from_*
   defaults to the value of the :attr:`~email.policy.Policy.mangle_from_`
   setting of the *policy* (which is ``True`` for the
   :data:`~email.policy.compat32` policy and ``False`` for all others).
   *mangle_from_* is intended for use when messages are stored in Unix mbox
   format (see :mod:`mailbox` and `WHY THE CONTENT-LENGTH FORMAT IS BAD
   <https://www.jwz.org/doc/content-length.html>`_).

It is set to False here:

mangle_from_ = False

@sobolevn sobolevn merged commit fed8d73 into python:main May 5, 2024
33 checks passed
@miss-islington-app
Copy link

Thanks @wimglenn for the PR, and @sobolevn for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 5, 2024
…y.__doc__ (pythonGH-118456)

* Fix mangle_from_ default value in email.policy.Policy.__doc__

The docstring says it defaults to True, but it actually defaults
to False. Only the Compat32 subclass overrides that.

---------

(cherry picked from commit fed8d73)

Co-authored-by: wim glenn <[email protected]>
Co-authored-by: Nikita Sobolev <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented May 5, 2024

GH-118586 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label May 5, 2024
sobolevn added a commit that referenced this pull request May 5, 2024
…cy.__doc__ (GH-118456) (#118586)

gh-118455: Fix mangle_from_ default value in email.policy.Policy.__doc__ (GH-118456)

* Fix mangle_from_ default value in email.policy.Policy.__doc__

The docstring says it defaults to True, but it actually defaults
to False. Only the Compat32 subclass overrides that.

---------

(cherry picked from commit fed8d73)

Co-authored-by: wim glenn <[email protected]>
Co-authored-by: Nikita Sobolev <[email protected]>
@wimglenn wimglenn deleted the mangle-from-default branch May 5, 2024 15:32
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
…y.__doc__ (python#118456)

* Fix mangle_from_ default value in email.policy.Policy.__doc__

The docstring says it defaults to True, but it actually defaults
to False. Only the Compat32 subclass overrides that.

---------

Co-authored-by: Nikita Sobolev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants