cpython/Lib/test/test_email
Miss Islington (bot) f738386838
[3.13] gh-143935: Email preserve parens when folding comments (GH-143936) (#144035)
gh-143935: Email preserve parens when folding comments (GH-143936)

Fix a bug in the folding of comments when flattening an email message
using a modern email policy. Comments consisting of a very long sequence of
non-foldable characters could trigger a forced line wrap that omitted the
required leading space on the continuation line, causing the remainder of
the comment to be interpreted as a new header field. This enabled header
injection with carefully crafted inputs.
(cherry picked from commit 17d1490aa9)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Denis Ledoux <dle@odoo.com>
2026-01-25 17:09:53 +00:00
..
data [3.13] gh-139434: Update selected RFC 2822 references to RFC 5322 (GH-139435) (#141024) 2025-11-04 16:22:31 -05:00
__init__.py [3.13] gh-71339: Use new assertion methods in the email tests (GH-129055) (GH-132501) 2025-05-22 09:40:04 +00: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.13] gh-143935: Email preserve parens when folding comments (GH-143936) (#144035) 2026-01-25 17:09:53 +00:00
test_asian_codecs.py
test_contentmanager.py [3.13] gh-71339: Use new assertion methods in the email tests (GH-129055) (GH-132501) 2025-05-22 09:40:04 +00:00
test_defect_handling.py [3.13] gh-68552: fix defects policy (GH-138579) (#142367) 2025-12-09 07:39:03 +00:00
test_email.py [3.13] gh-68552: fix defects policy (GH-138579) (#142367) 2025-12-09 07:39:03 +00:00
test_generator.py [3.13] gh-144125: email: verify headers are sound in BytesGenerator (#144181) 2026-01-25 17:09:26 +00:00
test_headerregistry.py [3.13] gh-79986: Add parsing for References/In-Reply-To email headers (GH-137201) (#142574) 2025-12-21 14:36:23 -05:00
test_inversion.py
test_message.py [3.13] gh-135307: Fix email error when policy max_line_length is set to 0 or None (GH-135367) (#140917) 2025-11-02 15:20:29 -05:00
test_parser.py
test_pickleable.py
test_policy.py [3.13] gh-144125: email: verify headers are sound in BytesGenerator (#144181) 2026-01-25 17:09:26 +00:00
test_utils.py gh-113027: Fix timezone check in test_variable_tzname in test_email (GH-113835) 2024-01-12 11:46:17 +01:00
torture_test.py bpo-5846: Do not use obsolete unittest functions. (GH-28303) 2021-09-13 10:49:53 +03:00