Daniel Pope <lord.ma...@gmail.com> added the comment:

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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34662>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to