Repository navigation
format_decimal: reject unsupported numbering systems with group_separator=False - #1369
Open
glaziermag wants to merge 1 commit into
Open
glaziermag wants to merge 1 commit into
glaziermag wants to merge 1 commit into
Conversation
Reject unsupported systems even when ungrouped integer output needs no locale number symbols. Assisted-by: OpenAI Codex
This branch has not been deployed
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.
With
group_separator=False,format_decimalsilently accepts an unsupported numbering system when the formatted fractional part is zero. Grouped output and output with a nonzero fractional part already raiseUnsupportedNumberingSystemError, because those rendering branches fetch number symbols and validate the system.Validate the numbering system immediately after parsing the locale, before formatting. The regression test covers zero, an integer, and a value rounded to an integer, with grouping enabled and disabled.
Minimal reproduction on unmodified master at
e2a17919f0eb988bfea2883b00793ca4d5d37c4f:Actual:
'1'. Expected:UnsupportedNumberingSystemError, as documented in the project's format_decimal API contract.Validation on Python 3.14.4 with the project's CLDR 48.2 data:
python -X utf8 -m pytest -q: 7,837 passed, 7 skipped, 2 xfailed.git diff --check: passed.Prepared and tested with OpenAI Codex.