[issue26231] HTTPResponse.close() should consume all remaining data in body if any

Martin Panter report at bugs.python.org
Thu Jan 28 05:59:57 EST 2016


Martin Panter added the comment:

The documentation already says you have to read the whole response before sending a new request: <https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.getresponse>. So I think this is more like a new feature than a bug fix, and would have to go into 3.6.

But I am not sure it is a good idea. What if the response is a large multi-megabyte download? In that case, it might make more sense to shut down the connection and start a new one.

It might be possible to add extra error checking to prevent reading a second response until the first is complete. I am not sure if that is practical or worthwhile though.

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26231>
_______________________________________


More information about the Python-bugs-list mailing list