Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
bpo-40071: Fix refleak in _functools module. #19172
I merged the PR to bring back Refleaks buildbots to green: the change fix https://bugs.python.org/issue40071
PR 19151 introduced a regression. If a second instance of _functools module is created and then destroyed, _functools_free() will clear kwd_mark. Later, if the first module instance is still used, it will likely crash since kwd_mark is now NULL :-(
C extension modules should not use static global variables, but use a module state.
Yes, I do. WIll send a PR and ask @corona10 for help if needed.
I suspect this is a little trickier because the module uses
It's used in lru_cache_make_key() which is called indirectly by:
Hum, maybe this change depends on PEP 573 implementation... which is not written yet! The PEP was just accepted.