[issue26499] http.client.IncompleteRead from HTTPResponse read after part reading file

Martin Panter report at bugs.python.org
Fri Mar 11 19:27:18 EST 2016


Martin Panter added the comment:

To add a second response you would just concatenate it to the existing response. (Your existing test already uses FakeSocket.) The FakeSocket parameter just represents data that would be sent from the server. So:

body = (
   b"HTTP/1.1 200 OK\r\n"
   b"Content-Length: 3\r\n"
   b"\r\n"
   b"abc"
   b"HTTP/1.1 408 Next response should not be read yet\r\n"
)

In fact, see the BasicTest.test_content_length_sync() case, which literally has "extradata" as that last line. I think we just need to adapt or duplicate this test to cover readline() and read1(), not just read(). Maybe also with read1(100), readline(100) cases as well.

----------

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


More information about the Python-bugs-list mailing list