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

2017-03-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b414e349eb6a6140a81ccec249bae3abe939e836 by Serhiy Storchaka (Ivan Levkivskyi) in branch '3.6': bpo-29638: Fix spurious refleaks after typing is imported (#469) (#483)

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

2017-03-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7acffa23c9e7866e5b4b98b8f3c28b14ec1c688c by Serhiy Storchaka (Ivan Levkivskyi) in branch 'master': bpo-29638: Fix spurious refleaks after typing is imported (#469)

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

2017-03-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

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

2017-03-05 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- pull_requests: +395 ___ Python tracker ___ ___

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

2017-03-05 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- pull_requests: +394 ___ Python tracker ___ ___

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

2017-03-05 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Seems this has fixed issue25744. This is interesting, if I remember correctly the relevant typing classes were added only recently. I will take a look at how to back-port this (probably this will require some code changes) --

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

2017-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Ivan! Seems this has fixed issue25744. Don't you mind to backport your changes to 3.6 and 3.5? -- versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

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

2017-03-05 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > If you just want to add a workaround in dash_R_cleanup, I think it would be > better to generate the list of all abstract classes and add three typing > classes to it. Yes, I just updated the PR. I have found something else unrelated to typing, this test

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

2017-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just wonder is there any other negative consequences? inspect.isabstract() returning False for abstract class looks a bug to me. If you just want to add a workaround in dash_R_cleanup, I think it would be better to generate the list of all abstract

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

2017-03-05 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > What if explicitly set __abstractmethods__ = True for these types? Unfortunately this does not help. I think this is because dash_R_cleanup only clears caches for classes in collections.abc.__all__ and their immediate .__subclasses__(). Making this

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

2017-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if explicitly set __abstractmethods__ = True for these types? -- ___ Python tracker ___

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

2017-03-05 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Are typing.ChainMap and others actually abstract classes? They are abstract classes in the sense that they are instances of abc.ABCMeta. However, for some reasons inspect checks __flags__ attribute. The latter probably reflects the fact that Deque etc. do

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

2017-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > So maybe we just need to add all ABC caches to typing._cleanups (just in > case). I don't know. Sorry, I didn't remember exactly reasons why I didn't move the clearing of all ABC caches into clear_caches(). Perhaps I suspected that this can have unwanted

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

2017-03-05 Thread Ivan Levkivskyi
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

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

2017-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there are problems with ABC caches of typing.ChainMap, typing.Counter, and typing.DefaultDict, why not add corresponding clearing methods obj._abc_cache.clear and obj._abc_negative_cache.clear to typing._cleanups ? Why there are problems only with ABC

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

2017-03-04 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- pull_requests: +387 ___ Python tracker ___ ___

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

2017-02-23 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi: This command: ./python -c 'import runpy, typing; runpy.run_module("test")' -R 5:5 test_collections Sometimes gives spurious failures like this: test_collections leaked [0, 0, 3, -3, 3] memory blocks, sum=3 I think this is because ABC caches of