[issue29638] Spurious failures in test_collections in releak hunting mode after typing is imported

Ivan Levkivskyi report at bugs.python.org
Sun Mar 5 10:21:32 EST 2017


Ivan Levkivskyi added the comment:

> why not add corresponding clearing methods obj._abc_cache.clear and obj._abc_negative_cache.clear to typing._cleanups ?

OK, this is another possible solution. I didn't think about this, because now typing._cleanups only clear generic caches (not ABC caches).

> Why there are problems only with ABC caches of these three types?

Normally, ABC caches are cleared in dash_R_cleanup, but I think that the problem is that inspect.isabstract returns False for these three types (unlike other types in typing module), see line 147 in refleak.py:

        if not isabstract(abc):
            continue

Actually now I think that the code in dash_R_cleanup might not clear some other caches also. So maybe we just need to add all ABC caches to typing._cleanups (just in case). What do you think, Serhiy?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29638>
_______________________________________


More information about the Python-bugs-list mailing list