[Python-checkins] CVS: python/dist/src/Lib httplib.py,1.20,1.21

Jeremy Hylton python-dev@python.org
Thu, 14 Sep 2000 13:34:31 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv29623

Modified Files:
	httplib.py 
Log Message:
cope with weird Content-Length values returned from servers by
ignoring them; e.g. Zope sometimes returns 13497L 


Index: httplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** httplib.py	2000/08/23 20:34:17	1.20
--- httplib.py	2000/09/14 20:34:27	1.21
***************
*** 167,171 ****
          length = self.msg.getheader('content-length')
          if length and not self.chunked:
!             self.length = int(length)
          else:
              self.length = None
--- 167,174 ----
          length = self.msg.getheader('content-length')
          if length and not self.chunked:
!             try:
!                 self.length = int(length)
!             except ValueError:
!                 self.length = None
          else:
              self.length = None