This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Oren Milman
Recipients Oren Milman
Date 2017-10-07.15:27:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507390047.35.0.213398074469.issue31723@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-10-07 15:27:27Oren Milmansetrecipients: + Oren Milman
2017-10-07 15:27:27Oren Milmansetmessageid: <1507390047.35.0.213398074469.issue31723@psf.upfronthosting.co.za>
2017-10-07 15:27:27Oren Milmanlinkissue31723 messages
2017-10-07 15:27:27Oren Milmancreate