[Python-checkins] r60747 - in python/trunk: Lib/httplib.py Misc/NEWS

martin.v.loewis python-checkins at python.org
Tue Feb 12 19:47:35 CET 2008


Author: martin.v.loewis
Date: Tue Feb 12 19:47:34 2008
New Revision: 60747

Modified:
   python/trunk/Lib/httplib.py
   python/trunk/Misc/NEWS
Log:
Patch #1966: Break infinite loop in httplib when the servers
implements the chunked encoding incorrectly.
Will backport to 2.5.


Modified: python/trunk/Lib/httplib.py
==============================================================================
--- python/trunk/Lib/httplib.py	(original)
+++ python/trunk/Lib/httplib.py	Tue Feb 12 19:47:34 2008
@@ -573,6 +573,10 @@
         ### note: we shouldn't have any trailers!
         while True:
             line = self.fp.readline()
+            if not line:
+                # a vanishingly small number of sites EOF without
+                # sending the trailer
+                break
             if line == '\r\n':
                 break
 

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Tue Feb 12 19:47:34 2008
@@ -400,6 +400,9 @@
 Library
 -------
 
+- Patch #1966: Break infinite loop in httplib when the servers
+  implements the chunked encoding incorrectly.
+
 - Rename rational.py to fractions.py and the rational.Rational class
   to fractions.Fraction, to avoid the name clash with the abstract
   base class numbers.Rational.  See discussion in issue #1682.


More information about the Python-checkins mailing list