tmpfile and gzip combination problem
'wrb'
is not a valid mode.
This works fine:
import tempfile
import gzip
with tempfile.TemporaryFile(mode='w+b') as f:
f.write(data.decode('base64'))
f.flush()
f.seek(0)
gzf = gzip.GzipFile(mode='rb', fileobj=f)
print gzf.read()