[Python-checkins] cpython (merge 3.2 -> default): httplib - minor update to check empty response

senthil.kumaran python-checkins at python.org
Sun Apr 29 04:40:45 CEST 2012


http://hg.python.org/cpython/rev/6c227c1a80dd
changeset:   76607:6c227c1a80dd
parent:      76605:cfff6a53f4a3
parent:      76606:1a9d38966395
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Sun Apr 29 10:40:23 2012 +0800
summary:
  httplib - minor update to check empty response

files:
  Lib/http/client.py |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Lib/http/client.py b/Lib/http/client.py
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -557,7 +557,7 @@
                 # 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
 
     def _readall_chunked(self):
@@ -789,7 +789,7 @@
             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):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list