The documentation for gzip.GzipFile contains this paragraph:
Calling a GzipFile object’s close() method does not close fileobj, sin
close()
fileobj