Generate 16+MAX_WBITS decompressable data

F

Fayaz Yusuf Khan

I'm trying write unit-tests for some of my old code and have run into this
piece of code.

dcomp = zlib.decompressobj(16+zlib.MAX_WBITS)
chunk = ''.join(f.chunks())
received_data = dcomp.decompress(chunk)

How do I generate the chunk here? From what I've been trying I'm getting
this exception:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
zlib.error: Error -3 while decompressing data: incorrect header check

zlib.decompress without the second argument works, but I can't really go
ahead into my project file and remove it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top