python / cpython

The Python programming language
https://www.python.org/
Other
60.06k stars 29.09k forks source link

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

Closed wimglenn closed 2 weeks ago

wimglenn commented 2 weeks ago

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 https://github.com/python/cpython/commit/fdb23c2fe5499d26701fa34873c1cdc347adcb80 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

savannahostrowski commented 2 weeks ago

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