Skip to content
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

isoparse: Fail with inconsistent time separators #1125

Merged
merged 2 commits into from Jul 2, 2021

Conversation

mariocj89
Copy link
Member

@mariocj89 mariocj89 commented May 17, 2021

Summary of changes

Fail when separators are used inconsistently to split the time porting
of a string. Even if more restrictive, we have warned that we were going
to fail on invalid cases of ISO formatted strings. This will prevent
invalid iso formatted strings from being unexpectedly parsed.

This Pr also fixes an xfail that was xfailing due to a typo. IIUC, 201202 is a valid ISO time but not a valid iso date, which is what was intended to be tested.

Closes None

Pull Request Checklist

  • Changes have tests
  • Authors have been added to AUTHORS.md
  • News fragment added in changelog.d. See CONTRIBUTING.md for details

Fail when separators are used inconsistently to split the time porting
of a string. Even if more restrictive, we have warned that we were going
to fail on invalid cases of ISO formatted strings. This will prevent
invalid iso formatted strings from being unexpectedly parsed.
The test was meant to validate `parse_isodate` but was using
`parse_isotime` instead. Move the test case to the list validating
invalid formats.
@mariocj89 mariocj89 merged commit 54a756d into dateutil:master Jul 2, 2021
@mariocj89 mariocj89 deleted the pu/strict-iso-sep branch July 2, 2021 15:06
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.

None yet

2 participants