Message173505
When calling HTTPResponse.read() on a response that is:
a. not chunked
b. contains no content-length header
the underlying socket (referenced by self.fp) will never get closed (through self.close())
The offending code is at the bottom of the read() function:
s = self.fp.read(amt)
if self.length is not None:
self.length -= len(s)
if not self.length:
self.close()
return s
As seen, if self.length is None, even when the server closes the connection (causing self.fp.read to return ''), the socket will not get closed.
btw, this may be the cause of Issue15633 (http://bugs.python.org/issue15633) |
|
Date |
User |
Action |
Args |
2012-10-22 11:32:32 | eranrund | set | recipients:
+ eranrund |
2012-10-22 11:32:32 | eranrund | set | messageid: <1350905552.38.0.183421910215.issue16298@psf.upfronthosting.co.za> |
2012-10-22 11:32:32 | eranrund | link | issue16298 messages |
2012-10-22 11:32:31 | eranrund | create | |
|