diff --git a/Misc/NEWS.d/next/Library/2024-12-11-17-44-36.gh-issue-127794.VwmRsp.rst b/Misc/NEWS.d/next/Library/2024-12-11-17-44-36.gh-issue-127794.VwmRsp.rst index bc5fe80624669f..db6d3f8d8ccb32 100644 --- a/Misc/NEWS.d/next/Library/2024-12-11-17-44-36.gh-issue-127794.VwmRsp.rst +++ b/Misc/NEWS.d/next/Library/2024-12-11-17-44-36.gh-issue-127794.VwmRsp.rst @@ -1,3 +1,4 @@ The :meth:`email.message.Message.add_header` method now validates header -field names according to :rfc:`5322` when headers are added via add_header -or __setitem__ and raises a ValueError if they contain invalid characters. +field names according to :rfc:`5322` and raises a :exc:`ValueError` if +they contain invalid characters. A similar argument applies if headers +are added through :meth:`Message.__setitem__ `.