Skip to content Skip to sidebar Skip to footer

Read A Gzip File From A Url With Zlib In Python 2.7

I'm trying to read a gzip file from a url without saving a temporary file in Python 2.7. However, for some reason I get a truncated text file. I have spend quite some time searchin

Solution 1:

Because that gzip file consists of many concatenated gzip streams, as permitted by RFC 1952. gzip automatically decompresses all of the gzip streams.

You need to detect the end of each gzip stream and restart the decompression with the subsequent compressed data. Look at unused_data in the Python documentation.

Post a Comment for "Read A Gzip File From A Url With Zlib In Python 2.7"