[New-bugs-announce] [issue33418] Memory leaks in functions

Jeroen Demeyer report at bugs.python.org
Thu May 3 13:54:23 EDT 2018


New submission from Jeroen Demeyer <J.Demeyer at UGent.be>:

This is a memory leak:

>>> while True:
...    def f(): pass
...    f.__doc__ = f

This also:

>>> while True:
...     f = [].append                                                                                                                                                   
...     f.__module__ = f

This is because the classes "function" and "builtin_function_or_method" do not implement tp_clear.

----------
messages: 316125
nosy: jdemeyer
priority: normal
severity: normal
status: open
title: Memory leaks in functions

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33418>
_______________________________________


More information about the New-bugs-announce mailing list