Kristján Valur Jónsson added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19009>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to