Message180513
Actually previous patch doesn't fix original problem, it only ensure that GzipFile consistent with BZ2File and LZMAFile.
To fix original problem we need other patch, and this patch looks as new feature for 3.4. Here is a sample patch for LZMAFile. BZ2File patch will be similar, and GzipFile patch will be more different and complex.
Now error doesn't raised immediately when read the file unexpectedly ended if some data can be read. Instead maximal possible part of read data returned and exception raising deferred to next read (see tests).
Perhaps we need a new flag for constructor or for read() which enables a new behavior (what will be a good name for this?). Or we can use a special value for size argument which means "read to the end as much as possible" (we can differentiate the behavior for size<0 and size=None). Unconditional enabling a new behavior for size >=0 is safe. |
|
Date |
User |
Action |
Args |
2013-01-24 07:43:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, loewis, calvin, ajaksu2, nadeem.vawda, python-dev, yeeeev |
2013-01-24 07:43:51 | serhiy.storchaka | set | messageid: <1359013431.35.0.665568797843.issue1159051@psf.upfronthosting.co.za> |
2013-01-24 07:43:51 | serhiy.storchaka | link | issue1159051 messages |
2013-01-24 07:43:51 | serhiy.storchaka | create | |
|