Author chortos
Recipients chortos
Date 2011-07-27.18:29:20
SpamBayes Score 0.000296094
Marked as misclassified No
Message-id <>
If a truncated input stream is given to the zlib.decompress function, it raises a zlib.error. However, if the same stream is fed to a zlib.Decompress object, no exception is raised during the entire lifetime of the object. Attached is an example demonstrating the discrepancy.

zlib.decompress raises this exception when it gets a Z_BUF_ERROR from zlib, while the implementation of zlib.Decompress.decompress just skips every Z_BUF_ERROR it gets as described in this (apparently inaccurate) comment:
        /* We will only get Z_BUF_ERROR if the output buffer was full
           but there wasn't more output when we tried again, so it is
           not an error condition.
Date User Action Args
2011-07-27 18:29:22chortossetrecipients: + chortos
2011-07-27 18:29:22chortossetmessageid: <>
2011-07-27 18:29:20chortoslinkissue12646 messages
2011-07-27 18:29:20chortoscreate