New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os.scandir(str) reference leak (test_os refleak) #73699
Comments
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 |
The owning of references in the path_t structure was changed in bpo-29034, but some code still directly manipulates reference counters of path_t fields. Proposed patch should fix the leak. |
3.7 doesn't leak, but contains outdated comment and code. |
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. |
If PyObject_New(ScandirIterator, &ScandirIteratorType) fails the path should be cleaned up by Argument Clinic. |
scandir-refleak-3.6.patch LGTM. The following removed Py_CLEAR() is just redundant, so it's ok to remove it.
|
Ohh yes. My stupid. Then both LGTM. |
New changeset 4e3a16bdadae by Serhiy Storchaka in branch '3.6': New changeset a3f8c5d172b4 by Serhiy Storchaka in branch 'default': |
Thanks for the quick fix Serhiy! I was working on patch and I like to check |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: