Skip to content

Reject invalid dates in the ISO-8601 handler instead of normalizing them - #615

Open
Eliot5566 wants to merge 3 commits into
kurtmckee:mainfrom
Eliot5566:fix-iso8601-invalid-dates
Open

Eliot5566 wants to merge 3 commits into
kurtmckee:mainfrom
Eliot5566:fix-iso8601-invalid-dates

Conversation

@Eliot5566

Copy link
Copy Markdown

Fixes #612. _parse_date_iso8601 now rejects explicitly present month/day outside 1..12 / 1..31, non-positive years, out-of-range hours/minutes/seconds and timezone offsets before time.mktime(), and checks the result stays within years 1..9999 — matching what the W3DTF handler already does. 0000-00-00, month 13 and 9999-12-31T23:59:59-99:99 now return None from _parse_date instead of a normalized wrong date. Adds 13 regression cases to tests/test_date_parsers.py plus a changelog fragment. Full test suite passes locally (4310 passed, 8 skipped).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant