Author serhiy.storchaka
Recipients ajaksu2, calvin, loewis, nadeem.vawda, python-dev, serhiy.storchaka, yeeeev
Date 2013-01-24.07:43:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359013431.35.0.665568797843.issue1159051@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-01-24 07:43:51serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, calvin, ajaksu2, nadeem.vawda, python-dev, yeeeev
2013-01-24 07:43:51serhiy.storchakasetmessageid: <1359013431.35.0.665568797843.issue1159051@psf.upfronthosting.co.za>
2013-01-24 07:43:51serhiy.storchakalinkissue1159051 messages
2013-01-24 07:43:51serhiy.storchakacreate