Repository navigation
Conversation
Author
|
Closing in favour of #2476, opened ~45 min earlier, which covers the same defect. I also had the premise wrong, and @harmehak0173 corrected it: I treated Thanks for picking it up, and for checking the agency's |
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.
What does this change
Removes the bogus
978/13registrant-group rules from thees_ESISBN provider soFaker("es_ES").isbn13()no longer emits ISBNs with an empty registrant segment.What was wrong
faker/providers/isbn/es_ES/__init__.pylists four ranges for group"13"with a registrant length of0(0100000-5999999,6050000-6999999,7350000-8749999,9000000-9899999). When one of those ranges is drawn,_registrant_publicationsplits the registrant as the empty string, andISBN13.format()joins it back as978-13--<digits>-<check>— one empty hyphen-delimited field in roughly 44% of 2000 seeded draws on master1879c986(878/2000), confirmed for bothes_ESandes(which inherits it) with 0/2000 for every other locale.The malformed samples are not parseable ISBN-13: the segment between the group and the publication is empty. Every other es path (
978/84) is unaffected.How this fixes it
Drops the
978/13group from the rules and keeps group84only, so every ISBN emitted is structurally well-formed. The978/13group with a zero-length registrant is not a usable ISBN shape, so removing it could only have produced the malformed output in question.Fixes #2472.
AI Assistance Disclosure (REQUIRED)
Checklist
make lintTest plan