Skip to content

Commit 06999db

Browse files
committed
gh-129640: Fix reference cycle in gzip.GzipFile
1 parent 9c69150 commit 06999db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/gzip.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ def seekable(self):
143143
def writable(self):
144144
return True
145145

146+
def __del__(self):
147+
del self.gzip_file
148+
146149

147150
class GzipFile(_compression.BaseStream):
148151
"""The GzipFile class simulates most of the methods of a file object with

0 commit comments

Comments
 (0)