[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread STINNER Victor
STINNER Victor added the comment: Thanks for the quick fix Serhiy! I was working on patch and I like to check for refleaks. Sadly, it wasn't noticed before. At least my test was pass :-) -- ___ Python tracker _

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset be85fd4ef41979dbe68262938da12328fb6cfb8c by Serhiy Storchaka in branch '3.6': Issue #29513: Fixed a reference leak in os.scandir() added in issue #29034. https://github.com/python/cpython/commit/be85fd4ef41979dbe68262938da12328fb6cfb8c --

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4e3a16bdadae by Serhiy Storchaka in branch '3.6': Issue #29513: Fixed a reference leak in os.scandir() added in issue #29034. https://hg.python.org/cpython/rev/4e3a16bdadae New changeset a3f8c5d172b4 by Serhiy Storchaka in branch 'default': Issue #2

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Xiang Zhang
Xiang Zhang added the comment: > If PyObject_New(ScandirIterator, &ScandirIteratorType) fails the path should > be cleaned up by Argument Clinic. Ohh yes. My stupid. Then both LGTM. -- stage: patch review -> commit review ___ Python tracker

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread STINNER Victor
STINNER Victor added the comment: scandir-refleak-3.6.patch LGTM. The following removed Py_CLEAR() is just redundant, so it's ok to remove it. -Py_CLEAR(iterator->path.object); -- ___ Python tracker _

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If PyObject_New(ScandirIterator, &ScandirIteratorType) fails the path should be cleaned up by Argument Clinic. -- assignee: -> serhiy.storchaka ___ Python tracker _

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Xiang Zhang
Xiang Zhang added the comment: 3.6 LGTM. 3.7 is technically right to me. But it looks to me AC shouldn't call path_cleanup in .c.h. It always do nothing. -- ___ Python tracker _

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 3.7 doesn't leak, but contains outdated comment and code. -- versions: +Python 3.7 Added file: http://bugs.python.org/file46609/scandir-refleak-3.7.patch ___ Python tracker _

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The owning of references in the path_t structure was changed in issue29034, but some code still directly manipulates reference counters of path_t fields. Proposed patch should fix the leak. -- keywords: +patch nosy: +xiang.zhang stage: -> patch revi

[issue29513] os.scandir(str) reference leak (test_os refleak)

2017-02-09 Thread STINNER Victor
New submission from STINNER Victor: The following code leaks one reference on Python 3.6: def test_attributes(self): d = dict((entry.name, entry) for entry in os.scandir('.')) Or try the command: ./python -m test -R 3:3 test_os -v -m test_attributes -- components: Libra