[Python-checkins] python/dist/src/Lib urllib2.py,1.68,1.69

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Tue Jun 29 09:19:31 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15318

Modified Files:
	urllib2.py 
Log Message:
[Bug #912845] urllib2 only checks for a 200 return code, but 206 is also legal if a Range: header was supplied.
(Actually, should the first 'if' statement be modified to allow any 2xx status code?)

Index: urllib2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** urllib2.py	7 Jun 2004 03:49:50 -0000	1.68
--- urllib2.py	29 Jun 2004 13:19:19 -0000	1.69
***************
*** 469,473 ****
          code, msg, hdrs = response.code, response.msg, response.info()
  
!         if code != 200:
              response = self.parent.error(
                  'http', request, response, code, msg, hdrs)
--- 469,473 ----
          code, msg, hdrs = response.code, response.msg, response.info()
  
!         if code not in (200, 206):
              response = self.parent.error(
                  'http', request, response, code, msg, hdrs)
***************
*** 997,1001 ****
              raise URLError(err)
  
!         if r.status == 200:
              # Pick apart the HTTPResponse object to get the addinfourl
              # object initialized properly
--- 997,1001 ----
              raise URLError(err)
  
!         if r.status in (200, 206):
              # Pick apart the HTTPResponse object to get the addinfourl
              # object initialized properly




More information about the Python-checkins mailing list