Skip to content

Reject impossible birth dates in Finnish identity codes - #511

Open
xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix/finnish-id-birthdates-20261013
Open

xiehuanyi wants to merge 1 commit into
python-validators:masterfrom
xiehuanyi:fix/finnish-id-birthdates-20261013

Conversation

@xiehuanyi

Copy link
Copy Markdown
Contributor

fi_ssn("310299-010F") accepts a nonexistent 31 February when the control character is correct. The same issue accepts 29 February 1800/1900.

Validate the complete birth date using the century marker before checking the serial and control character. This covers the additional century markers introduced in 2023, following the Finnish Tax Administration specification.

Tests: six invalid-date cases fail before the fix; four valid leap-year controls continue to pass. Full Tox lint, strict Pyright and Python 3.11–3.14 checks pass, with 1,181 tests per version. Ruff formatting and diff checks pass.

AI-assisted with GPT-6.1 Sol through Codex.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants