Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
bpo-43292: Fix file leak inET.iterparse()
when not exhausted#31696
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
bpo-43292: Fix file leak inET.iterparse()
when not exhausted#31696
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What if pass a path of non-existing file toiterparse()
,
Uh oh!
There was an error while loading.Please reload this page.
Thanks@jacobtylerwalls for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks@jacobtylerwalls for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…onGH-31696)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>(cherry picked from commit496c428)Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
bedevere-bot commentedMar 7, 2022
GH-31720 is a backport of this pull request to the3.9 branch. |
bedevere-bot commentedMar 7, 2022
GH-31721 is a backport of this pull request to the3.10 branch. |
…onGH-31696)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>(cherry picked from commit496c428)Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
…pythonGH-31696) (pythonGH-31720)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>(cherry picked from commit496c428)Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
bpo-43292: This fixes the file leak in
xml.etree.ElementTree.iterparse
when the iterator is garbage collected before being exhausted.Regression test fails on main.
Related, but not done in this PR:bpo-25707 is a request for an explicit
close()
method foriterparse()
. I am not certain if that feature would still be desired after this change.https://bugs.python.org/issue43292