Fix ISO Control Numbers Being Interpreted as Float#779
Open
DEMOCODE675 wants to merge 1 commit intoOWASP:mainfrom
Open
Fix ISO Control Numbers Being Interpreted as Float#779DEMOCODE675 wants to merge 1 commit intoOWASP:mainfrom
DEMOCODE675 wants to merge 1 commit intoOWASP:mainfrom
Conversation
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.
Fixes #546
Summary
This PR fixes a recurring issue where ISO control identifiers such as "7.10" were incorrectly interpreted as numeric values and converted to floats (7.10 → 7.1).
Section identifiers are structural strings, not numeric values. Converting them to floats removes trailing zeros and collapses distinct identifiers:
"7.10" ≠ "7.1"
"8.10" ≠ "8.1"
This PR ensures section IDs are treated as strings across all architectural boundaries and adds regression tests to prevent this issue from reoccurring(locally).
What This PR Changes
Fix numericise_ignore Off-by-One
Updated:
range(1, wsh.col_count + 1)Enforce String Type at All Boundaries
sectionID = str(sectionID)In Standard.__post_init__In Tool.__post_init__Normalize:
self.sectionID = str(self.sectionID) if self.sectionID is not None else ""New test file:
section_id_string_test.pyCovers:
Test Results
All relevant test suites were run locally:
36/36 tests passing
The new tests explicitly cover the exact failure modes described in issue #546 .
Why This Approach
Rather than fixing only the
spreadsheet.pybehavior, this PR:This ensures long-term stability and correctness of ISO control identifiers.
Result