Writing then reading in-memory bytes (BytesIO) gives a blank result
How about we write and read gzip content in the same context like this?
#!/usr/bin/env pythonfrom io import BytesIOimport gzipcontent = b"does it work"# write bytes to zip file in memorygzipped_content = Nonewith BytesIO() as myio: with gzip.GzipFile(fileobj=myio, mode='wb') as g: g.write(content) gzipped_content = myio.getvalue()print(gzipped_content)print(content == gzip.decompress(gzipped_content))