I
I
iROOT2013-11-25 09:53:56
Python
iROOT, 2013-11-25 09:53:56

How to unpack an inflate stream in python?

There is an Inflate stream that contains the names of the files to be extracted, it is known that the version of zlib 1.2.7 is used.
Need information on how to decompress an Inflate stream using Python (preferred).
zlib.decompress() does not decompress.
It unpacks perfectly if you pass through this function (thanks to the answerer)

def inflate(data):
    decompress = zlib.decompressobj(zlib.MAX_WBITS)
    inflated = decompress.decompress(data)
    inflated += decompress.flush()
    return inflated

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zxmd, 2013-11-25
@iROOT

And it is possible what thread an example of that that is necessary. And that as that is vaguely the task is presented.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question