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 lordmauve
Recipients lordmauve
Date 2018-09-13.17:39:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536860384.97.0.956365154283.issue34662@psf.upfronthosting.co.za>
In-reply-to
Content
I have several suggestions for steps to address this:

1. Don't create reference cycles. TarInfo.tarfile does not appear to be a documented attribute (https://docs.python.org/3/library/tarfile.html#tarinfo-objects) and could perhaps be deleted.
2. Issue a ResourceWarning in TarFile.__del__() if the TarFile was not closed prior to finalisation. ResourceWarnings are ignored by default but this would help when debugging. Given that the file may be corrupted perhaps something more visible than a ResourceWarning is required.
3. Make TarFile.__del__() close the TarFile cleanly. This is only possible if we can guarantee the underlying fileobj is finalized later (eg. because we have eliminated the reference cycle).
History
Date User Action Args
2018-09-13 17:39:45lordmauvesetrecipients: + lordmauve
2018-09-13 17:39:44lordmauvesetmessageid: <1536860384.97.0.956365154283.issue34662@psf.upfronthosting.co.za>
2018-09-13 17:39:44lordmauvelinkissue34662 messages
2018-09-13 17:39:44lordmauvecreate