Message141257
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:22 | chortos | set | recipients:
+ chortos |
2011-07-27 18:29:22 | chortos | set | messageid: <1311791362.59.0.0211250402323.issue12646@psf.upfronthosting.co.za> |
2011-07-27 18:29:20 | chortos | link | issue12646 messages |
2011-07-27 18:29:20 | chortos | create | |
|