]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-81074: Allow non-ASCII addr_spec in email.headerregistry.Address (#122477)
authorMike Edmunds <medmunds@gmail.com>
Fri, 1 May 2026 18:00:46 +0000 (11:00 -0700)
committerGitHub <noreply@github.com>
Fri, 1 May 2026 18:00:46 +0000 (14:00 -0400)
commitb60557382828a094f9da525cbd71c154bb97378b
tree0f0300a1cbb651d16249937367987b1bd9b789fc
parentd96ffc18320a58d164c1809871bb3aea7f549ac6
gh-81074: Allow non-ASCII addr_spec in email.headerregistry.Address (#122477)

The email.headerregistry.Address constructor raised an error if
addr_spec contained a non-ASCII character. (But it fully supports
non-ASCII in the separate username and domain args.) This change
removes the error for a non-ASCII addr_spec, as well as the
Defect that triggered it.  In the unicode era non-ascii is not a
defect, though it is an error when an attempt is made to serialize
it to ascii.  The serialization issue was handled in #122540.
Lib/email/_header_value_parser.py
Lib/email/errors.py
Lib/test/test_email/test__header_value_parser.py
Lib/test/test_email/test_headerregistry.py
Misc/NEWS.d/next/Library/2024-07-30-19-19-33.gh-issue-81074.YAeWNf.rst [new file with mode: 0644]