cpython/Misc/NEWS.d
Georges Toth 303aac8c56
bpo-30681: Support invalid date format or value in email Date header (GH-22090)
I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07.

The issue being solved () is still relevant. The original PR #10783 was closed as
the final request changes were not applied and since abandoned.

In this new PR I have re-used the original patch plus applied both comments from the review, by @maxking and @pganssle.


For reference, here is the original PR description:
In email.utils.parsedate_to_datetime(), a failure to parse the date, or invalid date components (such as hour outside 0..23) raises an exception. Document this behaviour, and add tests to test_email/test_utils.py to confirm this behaviour.

In email.headerregistry.DateHeader.parse(), check when parsedate_to_datetime() raises an exception and add a new defect InvalidDateDefect; preserve the invalid value as the string value of the header, but set the datetime attribute to None.

Add tests to test_email/test_headerregistry.py to confirm this behaviour; also added test to test_email/test_inversion.py to confirm emails with such defective date headers round trip successfully.

This pull request incorporates feedback gratefully received from @bitdancer, @brettcannon, @Mariatta and @warsaw, and replaces the earlier PR #2254.

Automerge-Triggered-By: GH:warsaw
2020-10-26 17:31:06 -07:00
..
next bpo-30681: Support invalid date format or value in email Date header (GH-22090) 2020-10-26 17:31:06 -07:00
3.5.0.rst
3.5.0a1.rst Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
3.5.0a2.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.5.0a3.rst
3.5.0a4.rst
3.5.0b1.rst
3.5.0b2.rst
3.5.0b3.rst
3.5.0b4.rst
3.5.0rc1.rst
3.5.0rc2.rst
3.5.0rc3.rst
3.5.0rc4.rst
3.5.1.rst
3.5.1rc1.rst
3.5.2.rst
3.5.2rc1.rst Fix typos in docs, comments and test assert messages (#14872) 2019-07-21 16:12:33 -04:00
3.5.3.rst
3.5.3rc1.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.5.4.rst
3.5.4rc1.rst Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
3.5.5.rst
3.5.5rc1.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.6.0.rst
3.6.0a1.rst Fix typos in docs, comments and test assert messages (#14872) 2019-07-21 16:12:33 -04:00
3.6.0a2.rst
3.6.0a3.rst
3.6.0a4.rst
3.6.0b1.rst Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
3.6.0b2.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.6.0b3.rst
3.6.0b4.rst
3.6.0rc1.rst Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
3.6.0rc2.rst
3.6.1.rst
3.6.1rc1.rst Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
3.6.2.rst
3.6.2rc1.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.6.2rc2.rst
3.6.3.rst
3.6.3rc1.rst Fix typos in docs, comments and test assert messages (#14872) 2019-07-21 16:12:33 -04:00
3.6.4.rst
3.6.4rc1.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.6.5.rst
3.6.5rc1.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.6.6.rst
3.6.6rc1.rst
3.7.0.rst
3.7.0a1.rst Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
3.7.0a2.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.7.0a3.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.7.0a4.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.7.0b1.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.7.0b2.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.7.0b3.rst
3.7.0b4.rst bpo-32523: Simplifying news entries with multiple paragraphs. (GH-8154) 2019-05-09 21:52:32 +02:00
3.7.0b5.rst
3.7.0rc1.rst
3.8.0a1.rst Remove duplicated words words (GH-20413) 2020-05-26 01:04:14 -07:00
3.8.0a2.rst Minor edits to news entries (ported from 3.7) (GH-12293) 2019-03-12 12:21:22 -04:00
3.8.0a3.rst IDLE: changelog correction and addition (GH-15042) 2019-07-31 01:35:30 -04:00
3.8.0a4.rst Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
3.8.0b1.rst Remove duplicated words words (GH-20413) 2020-05-26 01:04:14 -07:00
3.9.0a1.rst bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594) 2020-07-23 02:06:26 -04:00
3.9.0a2.rst Correct name of bytecode in change note. (GH-22723) 2020-10-19 13:20:33 +01:00
3.9.0a3.rst Python 3.9.0a3 2020-01-24 22:05:07 +01:00
3.9.0a4.rst Python 3.9.0a4 2020-02-25 22:06:39 +01:00
3.9.0a5.rst bpo-39871: Fix an error in a news entry (GH-21749) 2020-08-07 14:38:48 +09:00
3.9.0a6.rst Python 3.9.0a6 2020-04-27 22:44:04 +02:00
3.9.0b1.rst bpo-34956: edit and format better NEWS item in 3.9.0b1 changelog (GH-20255) 2020-05-20 05:41:26 -04:00
3.10.0a1.rst Delete PyGen_Send (#22663) 2020-10-12 12:10:42 -07:00