One function
find_the_correct_casing in dynaconf/dynaconf
The author described this change as “fix: skip non-str keys when resolving key casing (#1446)”. It counts as a record because the checks below fail on the code as it stood at 0e26bd6d6 and pass on 282f0935f, with nothing else changed between the two runs.
Projectdynaconf/dynaconf
Fix saved2026-08-05
Sharing licenceMIT · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a docstring
Given a key, find the proper casing in data. Return 'None' for non-str key types. Arguments: key {str} -- A key to be searched in data data {dict} -- A dict to be searched Returns: str -- The proper casing of the key in data
The change
| 3 | 3 | ) -> str | None: | |
| 4 | 4 | """Given a key, find the proper casing in data. | |
| 5 | 5 | ||
| 6 | - | Return 'None' for non-str key types. | |
| 6 | + | Non-str keys in data are skipped. | |
| 7 | 7 | ||
| 8 | 8 | Arguments: | |
| 9 | 9 | key {str} -- A key to be searched in data | |
| ⋯ | |||
| 16 | 16 | return key | |
| 17 | 17 | for k in data_keys: | |
| 18 | 18 | if not isinstance(k, str): | |
| 19 | - | return None | |
| 19 | + | continue | |
| 20 | 20 | if k.lower() == key.lower(): | |
| 21 | 21 | return k | |
| 22 | 22 | if k.replace(" ", "_").lower() == key.lower(): | |
The check that tells the two apart
fail→pass·tests/test_utils.py::test_find_the_correct_casing_skips_non_str_keys
fail→pass·tests/test_utils.py::test_merge_existing_dict_with_non_str_keys
Check file tests/test_utils.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it0e26bd6d69fe22ddc17f48fff5b2046d4403b3fa
Broken version dated2026-08-03
Moduledynaconf.utils.__init__
Units changedfind_the_correct_casing
Fingerprint307b34aea81a6236
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in dynaconf/dynaconf
- 2026-08-01get_history
- 2026-07-31fix: add __deepcopy__ to DataDict to match DataList (#1440)
- 2026-07-29normalize_kwargs
- 2026-07-29handle_metavalues
- 2026-07-29object_merge
- 2026-07-29fix(nodes): convert container subclasses (#1436)