This is not a duplicate post
I am facing below issue while reading a .gz(zip) file from GCS bucket in python
file name :ABC.dat.gz
content = downloaded_blob.read () . AttributeError: 'bytes' object has no attribute 'read'
code :
blob = bucket.blob('sftp/poc/ABC.dat.gz')
downloaded_blob = blob.download_as_string()
print(downloaded_blob)
content = downloaded_blob.read ()
buff = BytesIO (content) # put content into file object
f = gzip.GzipFile(fileobj=buff)
print('Lots of content here 8')
res = f.read().decode('utf-8')
print(res)