Skip to content

Preserve one-shot pairs in ConfigBox.merge_update - #353

Merged
cdgriffith merged 1 commit into
cdgriffith:developfrom
alexbertho:fix-configbox-one-shot-merge-pairs
Nov 11, 2026
Merged

cdgriffith merged 1 commit into
cdgriffith:developfrom
alexbertho:fix-configbox-one-shot-merge-pairs

Conversation

@alexbertho

Copy link
Copy Markdown
Contributor

ConfigBox.merge_update([iter(("host", {"name": "localhost"}))]) raises ValueError because case normalization unpacks each pair before the underlying merge reads it again. This also changes the existing key's spelling before the merge fails.

Materialize the inner pairs as well as the outer iterable so both passes see the same keys and values. Tests cover list and iterator outer inputs, merging nested configuration, the updated key spelling, and case-insensitive lookup. Both tests fail before the fix.

Validation on Linux, Python 3.12.14: full pure-Python suite, 697 passed and 1 skipped; Ruff lint and formatting, mypy, and git diff --check pass. Cython builds were not tested.

AI disclosure: investigated, implemented and tested with OpenAI Codex.

@cdgriffith
cdgriffith merged commit 447c641 into cdgriffith:develop Nov 11, 2026
@cdgriffith cdgriffith mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants