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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:ba8d59b0-cbd5-db6a-68a1-a8206639f6f0 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | B3AC:87739:1FB92EB:2C8C10F:696A5C81 |
| html-safe-nonce | 889c642417814c8a36817f7f8d481c06f5d838c8cee5e072304feb132e578fcb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0FDOjg3NzM5OjFGQjkyRUI6MkM4QzEwRjo2OTZBNUM4MSIsInZpc2l0b3JfaWQiOiIzMDk2OTU4Nzk0MTUxMzg2MjQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6e16d563373c07d29144050ceeb3f581bf2d530db23d5f2a84612989776d2e58 |
| hovercard-subject-tag | pull_request:479853219 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 |
| 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 full-width-p-0 |
| disable-turbo | false |
| 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