Title: bpo-30681: Support invalid date format or value in email Date header by sim0nx · Pull Request #22090 · python/cpython · GitHub
Open Graph Title: bpo-30681: Support invalid date format or value in email Date header by sim0nx · Pull Request #22090 · python/cpython
X Title: bpo-30681: Support invalid date format or value in email Date header by sim0nx · Pull Request #22090 · python/cpython
Description: I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07. The issue being solved (https://bugs.python.org/issue30681) 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. https://bugs.python.org/issue30681 https://bugs.python.org/issue30681 Automerge-Triggered-By: GH:warsaw
Open Graph Description: I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07. The issue being solved (https://bugs.python.org/issue30681) is still relevant. The original PR #10783 wa...
X Description: I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07. The issue being solved (https://bugs.python.org/issue30681) is still relevant. The original PR #10783 wa...
Opengraph URL: https://github.com/python/cpython/pull/22090
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c52b1b4b-1d86-bab7-9961-0e6b082f51fb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9DE4:8F2D5:1F47B82:2BF121F:696A5B76 |
| html-safe-nonce | 34f18b2215ed81e4b0c61a2f47b8eb14bc44b623ee88d95898fcf4fcdef44b46 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REU0OjhGMkQ1OjFGNDdCODI6MkJGMTIxRjo2OTZBNUI3NiIsInZpc2l0b3JfaWQiOiI3NzkxODUxMDI5MzIwNTg4MTUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 07b72767b8792a1d3ac15828bf3e1e0099e98192eb0a991ba01e41adf86667af |
| hovercard-subject-tag | pull_request:479853219 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/22090/files |
| twitter:image | https://avatars.githubusercontent.com/u/1769773?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1769773?s=400&v=4 |
| og:image:alt | I am re-submitting an older PR which was abandoned but is still relevant, #10783 by @timb07. The issue being solved (https://bugs.python.org/issue30681) is still relevant. The original PR #10783 wa... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width