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
Conversation
The docstring says it defaults to True, but it actually defaults to False. Only the Compat32 subclass overrides that.
8dd7c92
to
63e9592
Compare
@@ -0,0 +1 @@ | |||
Correct default value of mangle_from\_ in email.policy.Policy docstring |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 🤷
There was a problem hiding this 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:
cpython/Lib/email/_policybase.py
Line 166 in fed8d73
mangle_from_ = False |
…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]>
GH-118586 is a backport of this pull request to the 3.12 branch. |
…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]>
…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]>
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 ).