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

mangle_from_ default in email.policy.Policy.__doc__ is wrong #118455

Closed
wimglenn opened this issue May 1, 2024 · 1 comment
Closed

mangle_from_ default in email.policy.Policy.__doc__ is wrong #118455

wimglenn opened this issue May 1, 2024 · 1 comment
Labels
topic-email type-bug An unexpected behavior, bug, or error

Comments

@wimglenn
Copy link
Contributor

wimglenn commented May 1, 2024

Bug report

Bug description:

>>> from email.policy import Policy
>>> Policy.mangle_from_
False
>>> print(Policy.__doc__)
...
    mangle_from_        -- a flag that, when True escapes From_ lines in the
                           body of the message by putting a `>' in front of
                           them. This is used when the message is being
                           serialized by a generator. Default: True.
...

This attribute was added in fdb23c2 and was always False by default, as far as I can see.

The docs also correctly say that it defaults to False. I don't know why the class docstring says otherwise.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@wimglenn wimglenn added the type-bug An unexpected behavior, bug, or error label May 1, 2024
sobolevn added a commit that referenced this issue May 5, 2024
…c__ (#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]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue 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]>
sobolevn added a commit that referenced this issue 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]>
@savannahostrowski
Copy link
Contributor

I think this can be closed now, right? Not sure why this didn't auto-close when the PR was merged.

@wimglenn wimglenn closed this as completed May 7, 2024
SonicField pushed a commit to SonicField/cpython that referenced this issue 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
Labels
topic-email type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants