Repository navigation
Fix recursive ignore_case=KEYS normalization - #5859
Merged
pekkaklarck merged 1 commit intoNov 18, 2026
Merged
Conversation
Normalizer.__bool__ only checked the currently active ignore_case flag. When ignore_case=KEYS normalized dictionary values, ignore_case was temporarily False, so nested containers were returned as-is and their keys were never normalized. Include ignore_key_case and ignore_value_case in the check and add acceptance tests for nested dictionaries and lists.
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 #5858.
Problem
Dictionaries Should Be Equaldocumentsignore_case=KEYSas recursive, but nested dictionary keys kept their original case. With{A: {B: Value}}and{a: {b: Value}}the comparison failed withKey a: {'B': 'Value'} != {'b': 'Value'}, and the same happened when the nested dictionary was inside a list.Root cause
Normalizer.__bool__only checked the currently activeignore_caseflag. While normalizing dictionary values inKEYSmode,ignore_caseis temporarilyFalse, sonormalize()returned nested containers unchanged and their keys were never normalized.Fix
Include
ignore_key_caseandignore_value_caseinNormalizer.__bool__, so recursion continues while either dimension is active. Per-level folding is still controlled by the temporaryignore_casevalue, soKEYSstill ignores only keys andVALUESstill ignores only values.Tests
Two new acceptance cases:
ignore_case=KEYSignore_case=KEYS(negative test)Validation
wangqiao258/robotframework#1): Unit tests and Acceptance tests pass on Ubuntu + Windows with Python 3.9 and 3.148e6a235: both nested cases fail before the patch and pass after itinvoke formatandgit diff --checkpassAI disclosure: prepared with AI assistance; I reviewed the change and ran the tests myself.