Commit Graph
3 Commits
Author SHA1 Message Date
dualfroz 88a0720c67 fix: prevent RecursionError when a dict contains itself (#592)
BaseDict._get_dict_or_value() recursively unwraps nested benedict
values with no cycle detection, so assigning a benedict into its own
nested descendant a second time recurses forever and crashes with
RecursionError. Track ids of mappings currently being unwrapped and
raise a clear ValueError as soon as a self-reference is detected,
instead of recursing into unrelated, equally unprotected traversal
code until the interpreter stack overflows.
2026-09-04 06:08:50 +02:00
upstream 6701da5cf1 Upstream fabiocaccamo/python-benedict state of the touched files before 8e13b67bfe 2026-09-04 06:08:50 +02:00
dualfroz f8fdadb938 fix: prevent RecursionError when a dict contains itself (#592)
BaseDict._get_dict_or_value() recursively unwraps nested benedict
values with no cycle detection, so assigning a benedict into its own
nested descendant a second time recurses forever and crashes with
RecursionError. Track ids of mappings currently being unwrapped and
raise a clear ValueError as soon as a self-reference is detected,
instead of recursing into unrelated, equally unprotected traversal
code until the interpreter stack overflows.
2026-09-06 01:10:16 +02:00