Skip to content

Validate French SSN birthplace widths without a control key - #549

Open
123qeew wants to merge 1 commit into
python-validators:masterfrom
123qeew:fix/ssn-birthplace-width
Open

123qeew wants to merge 1 commit into
python-validators:masterfrom
123qeew:fix/ssn-birthplace-width

Conversation

@123qeew

@123qeew 123qeew commented Oct 26, 2026

Copy link
Copy Markdown

fr_ssn("1 84 12 76 45 089") and fr_ssn("1 84 12 971 451 089") return True: omitting the optional control key bypasses the existing check on department/town widths. The first value has too few birthplace digits and the second has too many.

Run that structural check before the optional-control-key return. Add four invalid cases and three valid cases without control keys, covering mainland, Corsica, overseas and foreign birthplaces.

Validation: four new cases fail before the fix. The full default pytest run passes 1,523 tests; tox -e lint,type,format,sast,py313 also passes (1,581 tests and doctests). Baseline default pytest: 1,516 passing tests.

Found and implemented with Codex during a code audit; the reproduction and checks were run locally.

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.

1 participant