fix(pt_BR): correct BBAN length so iban() generates valid Brazilian IBANs#2410
Open
CedricConday wants to merge 1 commit into
Open
fix(pt_BR): correct BBAN length so iban() generates valid Brazilian IBANs#2410CedricConday wants to merge 1 commit into
CedricConday wants to merge 1 commit into
Conversation
…BANs The pt_BR bank provider used a 25-digit + 2-letter bban_format, producing 31-character IBANs. Brazil's official IBAN length is 29 (25-char BBAN: 23 digits + 1 letter + 1 alphanumeric), so every generated value failed length validation against the ISO 13616 registry (verified with python-stdnum). The provider's own comment already documented the intended '23 digits + 2' layout, so this corrects an off-by-two typo. Reduce bban_format to 23 digits and add a TestPtBr test asserting the BBAN format, IBAN validity, country code, and 29-character length.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-opens #2407, which was closed in error (an automated cleanup pass on my account closed a batch of valid PRs and deleted their branches — this restores the work).
Problem:
Faker("pt_BR").iban()produced IBANs that fail checksum/length validation.Fix: correct the
bban_formatso generated IBANs are structurally valid.Verified against
python-stdnum(the reference validator): 300/300 generated IBANs now passstdnum.iban.validate(). Example:BR9887813621020815191610147AZ.AI disclosure: Prepared with AI assistance (Claude / Claude Code). All output was human-reviewed and verified — generated IBANs validated against
python-stdnumand the test suite passes.