From: Senthil Kumaran Date: Sun, 29 Apr 2012 02:39:49 +0000 (+0800) Subject: httplib - minor update to check empty response X-Git-Tag: v3.3.0a3~48^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e70a5c16918386ced63a36efb79257b75fa7500;p=thirdparty%2FPython%2Fcpython.git httplib - minor update to check empty response --- diff --git a/Lib/http/client.py b/Lib/http/client.py index 6828f146a7c3..d226f63ac4ad 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -563,7 +563,7 @@ class HTTPResponse(io.RawIOBase): # a vanishingly small number of sites EOF without # sending the trailer break - if line == b"\r\n": + if line in (b'\r\n', b'\n', b''): break # we read everything; close the "file" @@ -718,7 +718,7 @@ class HTTPConnection: if not line: # for sites which EOF without sending a trailer break - if line == b'\r\n': + if line in (b'\r\n', b'\n', b''): break def connect(self):