1. Fix bug in (de)compression objects. The final string resize used
zst.total_out to determine the length of the string, but the
(de)compression object will output data a little bit at a time, which
means total_out is not the string size. Fix: save original value of
total_out at the start of the call.
2. Be sure to Py_DECREF the result value if you exit with an
exception.
3. Use PyInt_FromLong instead of Py_BuildValue
4. include more constants from the zlib header file
5. Use PyErr_Format instead of using a local buffer and sprintf.
-- initialize length to DEFAULTALLOC and not 0
-- resize string before returning (to remove '\000' padding)
Also converted some compression routines to use PyString instead of
buffer.
Change default alloc size for uncompressing to 16K.
Remove comment about core dumps when an invalid window sizes is used.
This bug has been fixed in zlib 1.0.4.
Two new optional arguments to decompress, wbits and bufsize. wbits
specifies the window size and bufsize specifies the initial output
string size.
In decompression code -- decompress and decompressobj methods -- use a
Python string (and _PyString_Resize) to collect the uncompressed
stream. Replaces a separate buffer that was copied into a string.
Fix bug in decompress that caused it to always realloc the buffer when
it was finished decompressing.
Modernized handling of optional arguments to compressobj.
Updated doc strings.