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 kristjan.jonsson
Recipients kristjan.jonsson, orsenthil, pitrou, r.david.murray, serhiy.storchaka
Date 2013-09-16.22:29:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379370541.7.0.285916803238.issue19009@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, I'm adding a more comprehensive patch.  It adds support for
peek, readline, and read1 for both regular and chunked responses.
readline falls back to IOBase.readline for chunked, which again makes use of peek() for performance.
read1() is available for other kinds of client buffering, e.g. when reading the stream incrementally using other delimiters than newline.

The real work is done by the _read1_or_peek_chunked() method.  the code for both cases is almost identical so a dual purpose method is warranted.

Added test cases to test this.  The test cases don't attempt to test that we don't block on partial resopnses, though.  I'm not sure how I would write such a test.  I'd probably have to extend FakeSocket to work on some stream that can be appended to...
History
Date User Action Args
2013-09-16 22:29:01kristjan.jonssonsetrecipients: + kristjan.jonsson, orsenthil, pitrou, r.david.murray, serhiy.storchaka
2013-09-16 22:29:01kristjan.jonssonsetmessageid: <1379370541.7.0.285916803238.issue19009@psf.upfronthosting.co.za>
2013-09-16 22:29:01kristjan.jonssonlinkissue19009 messages
2013-09-16 22:29:00kristjan.jonssoncreate