[New-bugs-announce] [issue15633] httplib.response is not closed after all data has been read

Nikolaus Rath report at bugs.python.org
Mon Aug 13 03:31:03 CEST 2012

New submission from Nikolaus Rath:

Occasionally, the isclosed() method of HTTPResponse instances returns False, even though a preceding read() call returned '' (or something else that evalues to False).

This is a problem, because then the corresponding HTTPConnection can still be used to send another request, but an attempt to retrieve its response result it in ResponseNotReady() exception.

I have not found anything special about the requests for which this happens. I also looked at the httplib code and found no way for this to happen, but obviously I am missing something. Maybe someone more familiar with the codebase can tell what's happening there.

The problem happens to rarely to be able to run packet capture, but I can provide attributes of the relevant httplib instances if desired.

components: Library (Lib)
messages: 168068
nosy: Nikratio
priority: normal
severity: normal
status: open
title: httplib.response is not closed after all data has been read
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list