cpython/Misc/NEWS.d/next/Library
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
..
2019-12-05-05-22-49.bpo-38976.5MG7Uu.rst bpo-38976: Add support for HTTP Only flag in MozillaCookieJar (#17471) 2020-10-23 15:48:55 -07:00
2020-01-19-18-40-26.bpo-27321.8e6SpM.rst bpo-27321 Fix email.generator.py to not replace a non-existent header. (GH-18074) 2020-10-19 15:49:19 -07:00
2020-05-04-12-16-00.bpo-40492.ONk9Na.rst bpo-40492: Fix --outfile with relative path when the program changes it working dir (GH-19910) 2020-10-18 23:48:31 +03:00
2020-05-14-16-01-34.bpo-40592.Cmk855.rst bpo-40592: shutil.which will not return None anymore if ; is the last char in PATHEXT (GH-20088) 2020-10-23 11:08:24 +01:00
2020-05-31-10-48-47.bpo-4356.P8kXqp.rst bpo-4356: Add key function support to the bisect module (GH-20556) 2020-10-19 22:04:01 -07:00
2020-07-08-09-45-00.bpo-16936.z8o8Pn.rst bpo-16396: Allow wintypes to be imported on non-Windows systems. (GH-21394) 2020-10-19 23:06:05 +01:00
2020-08-19-08-32-13.bpo-41586.IYjmjK.rst bpo-41586: Add pipesize parameter to subprocess & F_GETPIPE_SZ and F_SETPIPE_SZ to fcntl. (GH-21921) 2020-10-19 16:30:02 -07:00
2020-09-04-17-33-04.bpo-30681.LR4fnY.rst bpo-30681: Support invalid date format or value in email Date header (GH-22090) 2020-10-26 17:31:06 -07:00
2020-09-08-23-41-29.bpo-41747.M6wLKv.rst bpo-41747: Ensure all dataclass methods uses their parents' qualname (GH-22155) 2020-10-21 09:49:22 -04:00
2020-09-13-02-02-18.bpo-39337.L3NXTt.rst bpo-39337: encodings.normalize_encoding() now ignores non-ASCII characters (GH-22219) 2020-10-14 17:43:31 +02:00
2020-09-22-11-07-50.bpo-41831.k-Eop_.rst bpo-41831: Restore str implementation of __str__ in tkinter.EventType (GH-22355) 2020-10-09 22:57:34 +03:00
2020-09-29-16-23-54.bpo-41876.QicdDU.rst bpo-41876: Overload __repr__ for tkinter Font objects (GH-22450) 2020-10-14 13:02:51 +03:00
2020-09-30-11-05-11.bpo-23706.dHTGjF.rst bpo-23706: Add newline parameter to pathlib.Path.write_text (GH-22420) (GH-22420) 2020-10-20 19:08:19 -07:00
2020-10-01-21-11-03.bpo-41905._JpjR4.rst bpo-41905: Add abc.update_abstractmethods() (GH-22485) 2020-10-06 10:40:50 -07:00
2020-10-03-23-14-50.bpo-41923.Buonw9.rst bpo-41923: PEP 613: Add TypeAlias to typing module (#22532) 2020-10-07 14:44:31 -07:00
2020-10-08-18-22-28.bpo-41976.Svm0wb.rst bpo-41976: Fix the fallback to gcc of ctypes.util.find_library when using gcc>9 (GH-22598) 2020-10-08 19:31:19 +01:00
2020-10-11-21-43-03.bpo-39101.-I49Pm.rst bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654) 2020-10-26 09:28:17 -07:00
2020-10-12-21-21-24.bpo-42021.8yv_8-.rst bpo-42021: Fix possible ref leaks during _sqlite3 module init (GH-22673) 2020-10-15 21:20:15 +09:00
2020-10-15-17-20-37.bpo-42043.OS0p_v.rst bpo-42043: Add support for zipfile.Path subclasses (#22716) 2020-10-25 14:45:05 -04:00
2020-10-16-07-45-35.bpo-35823.SNQo56.rst bpo-35823: subprocess: Use vfork() instead of fork() on Linux when safe (GH-11671) 2020-10-23 17:47:01 -07:00
2020-10-16-16-08-04.bpo-28660.eX9pvD.rst bpo-28660: Make TextWrapper break long words on hyphens (GH-22721) 2020-10-18 20:01:15 +03:00
2020-10-16-22-48-01.bpo-19270.jd_gkA.rst bpo-19270: Fixed sched.scheduler.cancel to cancel correct event (GH-22729) 2020-10-19 10:33:43 +03:00
2020-10-17-07-52-53.bpo-41966.gwEQRZ.rst bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) 2020-10-18 17:49:48 +03:00
2020-10-17-23-17-18.bpo-42065.85BsRA.rst bpo-42065: Fix incorrectly formatted _codecs.charmap_decode error message (GH-19940) 2020-10-17 23:38:21 +03:00
2020-10-19-14-02-09.bpo-41491.d1BUWH.rst bpo-41491: plistlib: accept hexadecimal integer values in xml plist files (GH-22764) 2020-10-20 09:26:33 +02:00
2020-10-19-16-53-19.bpo-42089.R1dthW.rst bpo-42089: Sync with current cpython branch of importlib_metadata (GH-22775) 2020-10-19 14:14:21 -07:00
2020-10-21-23-45-02.bpo-41052.3N7J2J.rst bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 (GH-22870) 2020-10-24 21:14:23 +03:00
2020-10-23-08-54-47.bpo-41490.-Yk6OD.rst bpo-41490: ``path`` and ``contents`` to aggressively close handles (#22915) 2020-10-25 14:21:46 -04:00
2020-10-25-19-25-02.bpo-42146.6A8uvS.rst bpo-42146: Fix memory leak in subprocess.Popen() in case of uid/gid overflow (GH-22966) 2020-10-25 17:09:32 -07:00
2020-10-26-19-08-07.bpo-42157.Bdpa04.rst bpo-42157: Convert unicodedata.UCD to heap type (GH-22991) 2020-10-26 23:19:22 +01:00
README.rst

README.rst

Put news entry `blurb`_ files for the *Library* section in this directory.

.. _blurb: https://pypi.org/project/blurb/