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

Jeremy Hylton jhylton@users.sourceforge.net
Fri, 13 Apr 2001 07:57:10 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv11625

Modified Files:
	httplib.py 
Log Message:
SF patch #405845 by Martin von L÷wis
Fixes SF bug #405427.
If an http response has a bogus return code, e.g. 400.100, raise
BadStatusLine.  


Index: httplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** httplib.py	2001/02/01 23:35:20	1.33
--- httplib.py	2001/04/13 14:57:08	1.34
***************
*** 127,131 ****
              raise BadStatusLine(line)
  
!         self.status = status = int(status)
          self.reason = reason.strip()
  
--- 127,137 ----
              raise BadStatusLine(line)
  
!         # The status code is a three-digit number
!         try:
!             self.status = status = int(status)
!             if status < 100 or status > 999:
!                 raise BadStatusLine(line)
!         except ValueError:
!             raise BadStatusLine(line)
          self.reason = reason.strip()