Message56754
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. |
|
Date |
User |
Action |
Args |
2007-10-25 20:58:44 | calvin | set | spambayes_score: 0.0089689 -> 0.0089689 recipients:
+ calvin, loewis |
2007-10-25 20:58:44 | calvin | set | spambayes_score: 0.0089689 -> 0.0089689 messageid: <1193345924.83.0.835316745836.issue1159051@psf.upfronthosting.co.za> |
2007-10-25 20:58:44 | calvin | link | issue1159051 messages |
2007-10-25 20:58:44 | calvin | create | |
|