This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author calvin
Recipients calvin, loewis
Date 2007-10-25.20:58:44
SpamBayes Score 0.008968899
Marked as misclassified No
Message-id <1193345924.83.0.835316745836.issue1159051@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a new test script that works with simple strings and no file
objects. It reproduces the error by cutting off the last two bytes of
the GZIP data.

The resulting struct error is due to the read() methods missing a check
that the requested amount of data is actually returned. In this case
read(4) returned 2 bytes instead of 4, and the struct raises an error.

I think the easiest way to handle this is to introduce a
read_save(fileobj, size) method that checks that the read() data is of
the requested size, else raise an error (perhaps an IOError?).

btw: you can remove the t.{gz,py} files, the test_gzip_error.py replaces
them.
Files
File name Uploaded
test_gzip_error.py calvin, 2007-10-25.20:58:44
History
Date User Action Args
2007-10-25 20:58:44calvinsetspambayes_score: 0.0089689 -> 0.008968899
recipients: + calvin, loewis
2007-10-25 20:58:44calvinsetspambayes_score: 0.0089689 -> 0.0089689
messageid: <1193345924.83.0.835316745836.issue1159051@psf.upfronthosting.co.za>
2007-10-25 20:58:44calvinlinkissue1159051 messages
2007-10-25 20:58:44calvincreate