Fix sf bug 666219: assertion error in httplib.

The obvious way for this assertion to fail is if the LineAndFileWrapper constructor is called when an empty line.  Raise a BadStatusError before the call.
This commit is contained in:
Jeremy Hylton 2003-06-29 17:55:05 +00:00
parent b752c27801
commit b67695238d
1 changed files with 4 additions and 0 deletions

View File

@ -231,6 +231,10 @@ class HTTPResponse:
line = self.fp.readline()
if self.debuglevel > 0:
print "reply:", repr(line)
if not line:
# Presumably, the server closed the connection before
# sending a valid response.
raise BadStatusLine(line)
try:
[version, status, reason] = line.split(None, 2)
except ValueError: