cpython/Lib/test/test_email
Miss Islington (bot) 1404a4d9f2
[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 0f7cd5544a)

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>
2026-02-19 14:53:05 -05:00
..
data [3.14] gh-139434: Update selected RFC 2822 references to RFC 5322 (GH-139435) (#141025) 2025-11-04 16:23:16 -05:00
__init__.py bpo-43651: PEP 597: Fix test_email (GH-25158) 2021-04-05 12:30:12 +09:00
__main__.py
test__encoded_words.py bpo-43323: Fix UnicodeEncodeError in the email module (GH-32137) 2022-04-30 13:17:23 +03:00
test__header_value_parser.py [3.14] gh-143935: Email preserve parens when folding comments (GH-143936) (#144034) 2026-01-25 17:11:33 +00:00
test_asian_codecs.py gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00
test_contentmanager.py gh-71339: Use new assertion methods in the email tests (GH-129055) 2025-04-14 09:25:58 +03:00
test_defect_handling.py [3.14] gh-68552: fix defects policy (GH-138579) (#142366) 2025-12-09 07:39:01 +00:00
test_email.py [3.14] gh-68552: fix defects policy (GH-138579) (#142366) 2025-12-09 07:39:01 +00:00
test_generator.py [3.14] gh-144156: Fix email header folding concatenating encoded words (GH-144692) (#145009) 2026-02-19 14:53:05 -05:00
test_headerregistry.py [3.14] gh-144156: Fix email header folding concatenating encoded words (GH-144692) (#145009) 2026-02-19 14:53:05 -05:00
test_inversion.py
test_message.py [3.14] gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367) (#140915) 2025-11-02 10:03:12 -05:00
test_parser.py
test_pickleable.py
test_policy.py [3.14] gh-144156: Fix email header folding concatenating encoded words (GH-144692) (#145009) 2026-02-19 14:53:05 -05:00
test_utils.py gh-118761: Add test_lazy_import for more modules (#133057) 2025-05-05 22:46:05 +00:00
torture_test.py gh-126133: Only use start year in PSF copyright, remove end years (#126236) 2024-11-12 15:59:19 +02:00