Serhiy Storchaka added the comment: Warning is emitted in destructor, and exceptions in destructors are ignored. Hence turning it into error makes the test passed.
Tests were not correct, here is fixed patch. Yes, CleanContext does the work. But depending on it looks fragile. CleanContext can be removed after getting rid of all deprecated methods. I agree that we have to add the close() method to iterparse object. But this is new feature and separate issue. ---------- Added file: http://bugs.python.org/file41129/etree_iterparse_leak_2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25688> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com