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
calls PyObject_GetAttrString, but never DECREFs the values returned from the function. This means that these references are leaked, and the objects are never deallocated even if pandas is unimported.
I am happy to prepare a PR to fix this, but I'm not entirely sure what the code in question is even trying to do; it simply accesses these attributes and does nothing with the result.
Yea this is created in an init for the module when it is instantiated. I think could use a cleanup function attached to the module if you'd like to add
The code is assigning to a static object that gets referenced throughout actual usage of the program. This is arguably bad design so could refactor if more ambitious, but no expectations (there's a lot of spaghetti code)
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Various code starting at
pandas/pandas/_libs/src/ujson/python/objToJSON.c
Line 154 in 890d097
PyObject_GetAttrString
, but never DECREFs the values returned from the function. This means that these references are leaked, and the objects are never deallocated even if pandas is unimported.I am happy to prepare a PR to fix this, but I'm not entirely sure what the code in question is even trying to do; it simply accesses these attributes and does nothing with the result.
Found via python/cpython#98253.
Expected Behavior
No memory leaks
Installed Versions
The text was updated successfully, but these errors were encountered: