Skip to content

bpo-30681: Change error handling to return None in case of invalid date #2229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

timb07
Copy link
Contributor

@timb07 timb07 commented Jun 16, 2017

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.

@the-knights-who-say-ni
Copy link

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!

@brettcannon
Copy link
Member

@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 😄

@Mariatta
Copy link
Member

In addition to @brettcannon's comment, please also make the change against the master branch.
It can be backported to 3.6 once the PR on master has been merged.
I'm closing this PR for now.
Please reopen the PR once the appropriate changes have been made, and we can review it.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants