bpo-30681: Change error handling to return None in case of invalid date#2229
bpo-30681: Change error handling to return None in case of invalid date#2229timb07 wants to merge 2 commits intopython:3.6python/cpython:3.6from
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
|
@timb07 would you mind changing the email example to not be sexual in nature? Otherwise we will have to reject this PR since we attempt to keep the code kid-friendly thanks to actually having kids playing with Python's source 😄 |
|
In addition to @brettcannon's comment, please also make the change against the |
In email.utils.parsedate_to_datetime(), check failure to parse date, or invalid date components (such as hour outside 0..23), and return None rather than raising an exception.
Add tests to confirm this behaviour.