Author nirai
Recipients lucifer, nirai, pitrou
Date 2010-01-10.20:38:33
SpamBayes Score 5.06817e-14
Marked as misclassified No
Message-id <1263155918.49.0.0737524167047.issue7610@psf.upfronthosting.co.za>
In-reply-to
Content
If the sequence of readaheads is ['a\r', '\nb\n'], the first use of the pattern will consume 'a', then the peek(2) will trigger a read() and the next use of the pattern will consume '\r\n'.

I updated the patch and enhanced a little the inline comments to clear this up and added the suggested test.

I also ventured into a rewrite of the read() function since it seems to contain various latent bugs / problems, probably the result of ages of slow refactoring. For example, decompressor flush() depends on self.eof flag which is never set and the decrypter is fed by the raw buffer which is in turn set by the decompresser, thus theoretically feeding decrypted data back to the decrypter.

I also made it completely buffered so now small reads are significantly faster.

If this patch is good, i'll prepare a patch for python 3.x and 2.6
History
Date User Action Args
2010-01-10 20:38:38niraisetrecipients: + nirai, pitrou, lucifer
2010-01-10 20:38:38niraisetmessageid: <1263155918.49.0.0737524167047.issue7610@psf.upfronthosting.co.za>
2010-01-10 20:38:37nirailinkissue7610 messages
2010-01-10 20:38:37niraicreate