Skip to content

Reject calendar-invalid values in parse_date - #100

Open
ShahadatTest wants to merge 1 commit into
xolox:masterfrom
ShahadatTest:fix/calendar-date-validation
Open

ShahadatTest wants to merge 1 commit into
xolox:masterfrom
ShahadatTest:fix/calendar-date-validation

Conversation

@ShahadatTest

Copy link
Copy Markdown

parse_date('2023-02-29') currently succeeds, as do month 13 and hour 24, despite the documented InvalidDate contract. The resulting tuple then fails the documented datetime(*parse_date(...)) conversion.

Validate the assembled components with datetime.datetime before returning the original tuple. Existing abbreviated date defaults remain supported. Tests cover leap years, month/day/year bounds and time bounds, plus valid full and partial dates.

Validation: the invalid-date regression fails before the fix. Python 3.12: 65 passed, with the same six pre-existing Windows failures as the rerun baseline (63 passed). Three date tests pass on Python 3.10. No new Flake8 findings versus baseline; git diff --check passes.

AI assistance: OpenAI Codex (GPT-6). Original user request: new 14ta koro aro (make 14 more new contributions). Diff inspection was automated; no human review or personal production usage is claimed.

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.

1 participant