our team have to snippet like below:
this:
buf = StringIO.StringIO()
gzip.GzipFile(fileobj=buf, mode='wb').write(foo)
...
and this one:
buf = StringIO.StringIO()
tmp = gzip.GzipFile(fileobj=buf, mode='wb')
tmp.write(foo)
...
which one is more pythonic?
EDITED: I have try/catch to do the error handling work, but which one is more pythonic?