New submission from Oren Milman <ore...@gmail.com>: The following code causes refleaks: import zipimport zi = zipimport.zipimporter.__new__(zipimport.zipimporter) zi.__init__('bar.zip') zi.__init__('bar.zip') zi.__init__('bar.zip\\foo')
This is because zipimport_zipimporter___init___impl() (in Modules/zipimport.c) doesn't decref (if needed) before assigning to `self->files`, `self->archive` and `self->prefix`. I would open a PR to fix this soon. Should i add a test to test_zipimport? If yes, could you point out some similar refcount test to help me write this test? ---------- components: Extension Modules messages: 303883 nosy: Oren Milman priority: normal severity: normal status: open title: refleaks in zipimport when calling zipimporter.__init__() more than once type: resource usage versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31723> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com