diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py index 792072ab9f6128..94e6ebbb0dc983 100644 --- a/Lib/email/_header_value_parser.py +++ b/Lib/email/_header_value_parser.py @@ -2583,7 +2583,7 @@ def get_parameter(value): for t in token: if t.token_type == 'extended-attrtext': break - t.token_type == 'attrtext' + t.token_type = 'attrtext' appendto.append(t) param.charset = t.value if value[0] != "'": diff --git a/Misc/NEWS.d/next/Library/2026-05-26-13-05-48.gh-issue-150474.rMA2ig.rst b/Misc/NEWS.d/next/Library/2026-05-26-13-05-48.gh-issue-150474.rMA2ig.rst new file mode 100644 index 00000000000000..4327f288f1f029 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-05-26-13-05-48.gh-issue-150474.rMA2ig.rst @@ -0,0 +1,2 @@ +Fixed an issue in :mod:`email` where an incorrect comparison in the header value parser :func:`get_parameter` could lead to improper parameter handling. +Patch by Benedikt Johannes.