Skip to content

🐛 fix(py_info): preserve supplied JSON keys - #234

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:bug/203-property-json
Nov 3, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:bug/203-property-json

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

PythonInfo.to_dict() looked up each stored answer key as an attribute. An answer containing system_include could expand a 63 KB response into a 300 MB disk cache entry, as issue #203 records. Serialization now keeps the supplied value. Fixes #203.

A stored key invoked a computed property

from_dict() copies answer keys into instance state. Python's property descriptor takes precedence when an attribute with the same name is read, so the old getattr call ran system_include instead of reading the stored value. The revised serializer reads instance state while retaining the existing conversions for _creators and version_info.

Behavior changes

Keys in an interpreter answer now retain their supplied values during to_dict() and cache serialization, even when they match computed properties. Explicit access to info.system_include still computes the include path.

Reported by Anthropic's OSS Scanner: ANT-2026-Z3HMDW60.

@gaborbernat gaborbernat added the bug Something isn't working label Nov 3, 2026
@gaborbernat
gaborbernat merged commit 000d2b5 into tox-dev:main Nov 3, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON keys matching PythonInfo properties expand cache entries

1 participant