Skip to content

email.policy.default mypy error #130412

@cossor

Description

@cossor

Bug report

Bug description:

i anticipated that this issue would be resolved in Python 3.13.2 because i thought i saw a pull request for it, but that did not happen. (i have had false memories before.) mypy 1.14.0 also reports an error, 1.13.0 does not.

from email import parser, policy

"""
using Python 3.13.2, mypy 1.15.0 emits --
default_policy.py:10: error: Argument "policy" to "Parser" has incompatible type "EmailPolicy[EmailMessage]"; expected "Policy[Message[str, str]]"  [arg-type]
Found 1 error in 1 file (checked 1 source file)
"""


parser.Parser(policy=policy.default)

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions