STINNER Victor added the comment: Antoine: "I doubt it. If that was the case, the reference count would increase as well."
The bug is really weird :-) Antoine: "Actually, leak2.py doesn't attempt to cleanup anything between runs, so it can't be reliable for detecting leaks. You lack dash_R_cleanup() somewhere." I simplified dash_R_cleanup() and at the end, it was empty :-) I don't see how the test_current_frames() would need to clear any kind of cache. Maybe: * sys._clear_type_cache() * gc.collect() * C function clear_freelists() of gcmodule.c But I tried to call these functions, and it doesn't change anything. I don't see how calling set.add() and set.discard() would impact any cache, except of maybe of a free list? The strange thing is that calling dangling.clear() explicitly in test_current_frames() "fixes the leak" (hides the bug?). But any tiny change on this file also hides the bug. The script is very fragile. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31217> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com