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, serhiy.storchaka
Date 2013-09-13.15:35:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379086514.46.0.489448409415.issue19009@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is that self.fp is already a Buffered stream, and such streams are documented to have their read() and readinto() calls make multiple system calls to fullfill the request.

My original goal was actually to make response.read(amt) not try to make multiple read() calls, so that one could have other delimiters than newline.  It is simple for the chunked case, but I don't know how to bypass it for response.fp, since it is already a buffered file that has no guaranteed such behaviour.... wait, one can simply call peek() on it and know how much one can get :)

But anyway, the use case I have actually uses newlines as record separators in the http stream, so this enhancement seems less intrusive.

I'll add unit tests.  There ought to be ready-made HTTPResponse tests already that I can use as templates.
History
Date User Action Args
2013-09-13 15:35:14kristjan.jonssonsetrecipients: + kristjan.jonsson, orsenthil, pitrou, serhiy.storchaka
2013-09-13 15:35:14kristjan.jonssonsetmessageid: <1379086514.46.0.489448409415.issue19009@psf.upfronthosting.co.za>
2013-09-13 15:35:14kristjan.jonssonlinkissue19009 messages
2013-09-13 15:35:14kristjan.jonssoncreate