Download and decompress gzipped file in memory?
Download and decompress gzipped file in memory? Question: I would like to download a file using urllib and decompress the file in memory before saving. This is what I have right now: response = urllib2.urlopen(baseURL + filename) compressedFile = StringIO.StringIO() compressedFile.write(response.read()) decompressedFile = gzip.GzipFile(fileobj=compressedFile, mode=’rb’) outfile = open(outFilePath, ‘w’) outfile.write(decompressedFile.read()) This ends up writing empty …