Skip to content

Prevent infinite recursion in python variable logger#589

Merged
patkenneally merged 2 commits intodevelopfrom
fix/2110-prevent-inifinite-recursion-partially-constructed-object
Mar 23, 2026
Merged

Prevent infinite recursion in python variable logger#589
patkenneally merged 2 commits intodevelopfrom
fix/2110-prevent-inifinite-recursion-partially-constructed-object

Conversation

@patkenneally
Copy link
Collaborator

  • Tickets addressed: ema-gnc-2110
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

When setting a break point after the addition of a pythonVariableLogger, that break point is never hit. The issue is infinite recursion on the __getattr__ function in the python variable logger. Using __getattr__ needs to be defensive about partially-initialized state. Using self.__dict__["_variables"] avoids re-entering __getattr__ and raises a clean KeyError/AttributeError when the attribute doesn't exist yet.

Verification

Scenarios and tests that suffered from this error no longer do. CI runs.

Documentation

NA

Future work

None

@patkenneally patkenneally force-pushed the fix/2110-prevent-inifinite-recursion-partially-constructed-object branch from c6a7f06 to ecb59ee Compare March 23, 2026 19:36
@patkenneally patkenneally merged commit b1c2f3f into develop Mar 23, 2026
5 checks passed
@patkenneally patkenneally deleted the fix/2110-prevent-inifinite-recursion-partially-constructed-object branch March 23, 2026 20:23
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