Irit Katriel <iritkatr...@gmail.com> added the comment:

I think the leak happens when we invoke GC while the recursion limit is 
exceeded. It goes way if make this change:


    def recurse_in_body_and_except():
        try:
            recurse_in_body_and_except()
        except RecursionError as e:
            gc.disable()
            recurse_in_body_and_except()
            gc.enable()


I also added a __del__ to B and saw it being called when recursion limit is 
small (though adding the __del__ makes the leak go away. Actually just adding 
"def f(): pass" is enough to make it go away).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44895>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to