gzip a file in python,f.close()