]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-140601: Add ResourceWarning to iterparse when not closed (GH-140603)
authorOsama Abdelkader <78818069+osamakader@users.noreply.github.com>
Thu, 13 Nov 2025 19:05:28 +0000 (20:05 +0100)
committerGitHub <noreply@github.com>
Thu, 13 Nov 2025 19:05:28 +0000 (21:05 +0200)
commita486d452c78a7dfcd42561f6c151bf1fef0a756e
tree6055f22448cadce1c4c0c0793f47407f7a3a5416
parent209eaff68c3b241c01aece14182cb9ced51526fc
gh-140601: Add ResourceWarning to iterparse when not closed (GH-140603)

When iterparse() opens a file by filename and is not explicitly closed,
emit a ResourceWarning to alert developers of the resource leak.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/library/xml.etree.elementtree.rst
Doc/whatsnew/3.15.rst
Lib/test/test_xml_etree.py
Lib/xml/etree/ElementTree.py
Misc/NEWS.d/next/Library/2025-10-25-22-55-07.gh-issue-140601.In3MlS.rst [new file with mode: 0644]