Author eranrund
Recipients eranrund
Date 2012-10-22.11:32:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
When calling 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 =
        if self.length is not None:
            self.length -= len(s)
            if not self.length:
        return s
As seen, if self.length is None, even when the server closes the connection (causing to return ''), the socket will not get closed.

btw, this may be the cause of Issue15633 (
Date User Action Args
2012-10-22 11:32:32eranrundsetrecipients: + eranrund
2012-10-22 11:32:32eranrundsetmessageid: <>
2012-10-22 11:32:32eranrundlinkissue16298 messages
2012-10-22 11:32:31eranrundcreate