You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plone has a objects with a schema where the data property is loaded using a decorator which loads the data into memory on first access.
When validating this schema zope is just trying to check if such a property exists but by using getattr it will inadvertently load a large file into memory.
BUG/PROBLEM REPORT / FEATURE REQUEST
What I did:
Plone has a objects with a schema where the data property is loaded using a decorator which loads the data into memory on first access.
When validating this schema zope is just trying to check if such a property exists but by using getattr it will inadvertently load a large file into memory.
This is a PR to try and avoid this issue - plone/plone.namedfile#166
What I expect to happen:
Check if the the property is really a decorator first so it can be avoided being accessed unless really needed.
Maybe something like https://stackoverflow.com/questions/16169948/check-if-something-is-an-attribute-or-decorator-in-python ?
What actually happened:
getattr is used and the decorator will load all the data into memory even though the schema as not constraints on the contents of the property.
What version of Python and Zope/Addons I am using:
python 3.10, zope.schema 7.0.1
The text was updated successfully, but these errors were encountered: