[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread Nikhil Patel
Nikhil Patel added the comment: I'd like to respectfully disagree with the suggestions/conclusions mentioned here. I'll explain my reasoning and conclusions below. First the short version - I'm fairly confident the leak actually has to do with:

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor
STINNER Victor added the comment: It seems like compile() only leaks when using PyCF_ONLY_AST: compile(source, "filename", "exec", ast.PyCF_ONLY_AST) It's maybe a leak in the PyAST_mod2obj() function when creating dictionaries of created AST objects. But in ast_dealloc() of

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor
STINNER Victor added the comment: (Oops, I modified the file while uploading here. I reuploaded the correct bug.py.) -- Added file: http://bugs.python.org/file46930/bug.py ___ Python tracker

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file46929/bug.py ___ Python tracker ___

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-07 Thread STINNER Victor
STINNER Victor added the comment: I isolated the leak to attached bug.py script. Output: --- haypo@selma$ ./python bug.py [ Top 10 differences ] bug.py:40: size=6728 B (+6728 B), count=80 (+80), average=84 B bug.py:46: size=2464 B (+2464 B), count=28 (+28), average=88 B bug.py:43: size=2464 B

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-06 Thread Louie Lu
Louie Lu added the comment: Briefly speaking, I think this is not a *easy* issue. There is two things need to concern in this issue. First, it that the test case is *randomize*, lineno 282 randomly choice 10 file to test. So you will need to stabilize this first. Second, the minimize range

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-02 Thread Milan Oberkirch
Milan Oberkirch added the comment: I tried to pin this leak down and got to the point where I suspect the compile call: def check_roundtrip(self, code1, filename="internal"): ast1 = compile(code1, filename, "exec", ast.PyCF_ONLY_AST) the leaks occur with only that line in the

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-02 Thread STINNER Victor
STINNER Victor added the comment: > Haypo: How do you know that this is leaked at test_files() of > test_tools.test_unparse.DirectoryTestCase? The result of your command didn't > reveal that is leaked at which test case or function. Using the script I wrote which is attached to issue29512.

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-02 Thread Louie Lu
Louie Lu added the comment: Haypo: How do you know that this is leaked at test_files() of test_tools.test_unparse.DirectoryTestCase? The result of your command didn't reveal that is leaked at which test case or function. -- nosy: +louielu ___

[issue30542] [EASY] test_files() of test_tools.test_unparse.DirectoryTestCase leaks references

2017-06-02 Thread STINNER Victor
STINNER Victor added the comment: I tagged this issue as easy. I consider that it's a good exercice for new contributors. Core developers: please let new contributors try to fix it since this issue is not critical, try to explain how to fix it rather than writing the fix ;-) --