New submission from Brian Kearns: tarfile.gzopen relies on refcounting to close the fileobj when the fileobj is created during the call to gzopen (when it is not passed in). Since the fileobj is created outside of GzipFile, GzipFile does not take responsibility for closing the fileobj (so no one does, aside from the GC, which leads to unexpected behavior when using a non-refcounted GC).
This is fixed by having GzipFile open the fileobj itself, so it does take responsibility for closing it when necessary. The same approach is taken in tarfile.py in py3k branch. ---------- files: tarfile.patch keywords: patch messages: 225836 nosy: bdkearns priority: normal severity: normal status: open title: fix reliance on refcounting in tarfile.gzopen type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file36456/tarfile.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22266> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com