]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-144156: Fix email header folding concatenating encoded words (GH-144692...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 19 Feb 2026 19:53:05 +0000 (20:53 +0100)
committerGitHub <noreply@github.com>
Thu, 19 Feb 2026 19:53:05 +0000 (14:53 -0500)
commit1404a4d9f2a003ae801ea300b517a13419aebe88
treec7988a191655bdb73d8be09611470e7cea653429
parent24b53097d95782b3b5212a2be0d77d7cf3e28b99
[3.14] gh-144156: Fix email header folding concatenating encoded words (GH-144692) (#145009)

gh-144156: Fix email header folding concatenating encoded words (GH-144692)

The fix for gh-92081 (gh-92281) was unfortunately flawed, and broke whitespace handling for encoded word patterns that had previously been working correctly but had no corresponding tests, unfortunately in a way that made the resulting headers not RFC compliant, in such a way that Yahoo started rejecting the resulting emails.  This fix was released in 3.14 alpha 1, 3.13 beta 2 and 3.12.5.   This PR fixes the original problem in a way that does not break anything, and in fact fixes a small pre-existing bug (a spurious whitespace after the ':' of the header label if the header value is immediately wrapped on to the next line).  (RDM)
(cherry picked from commit 0f7cd5544a4dd1d7cf892c93c661510d619caaa7)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
Lib/email/_header_value_parser.py
Lib/test/test_email/test_generator.py
Lib/test/test_email/test_headerregistry.py
Lib/test/test_email/test_policy.py
Misc/NEWS.d/next/Core_and_Builtins/2026-02-10-22-05-51.gh-issue-144156.UbrC7F.rst [new file with mode: 0644]