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

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Sat Jul 10 17:34:37 CEST 2004


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

Modified Files:
	urllib2.py 
Log Message:
[Patch #988504] Fix HTTP error handling via a patch from John J. Lee

Index: urllib2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** urllib2.py	29 Jun 2004 13:19:19 -0000	1.69
--- urllib2.py	10 Jul 2004 15:34:34 -0000	1.70
***************
*** 997,1010 ****
              raise URLError(err)
  
!         if r.status in (200, 206):
!             # Pick apart the HTTPResponse object to get the addinfourl
!             # object initialized properly
!             resp = addinfourl(r.fp, r.msg, req.get_full_url())
!             resp.code = r.status
!             resp.msg = r.reason
!             return resp
!         else:
!             return self.parent.error("http", req, r.fp, r.status, r.msg,
!                                      r.msg.dict)
  
  
--- 997,1006 ----
              raise URLError(err)
  
!         # Pick apart the HTTPResponse object to get the addinfourl
!         # object initialized properly
!         resp = addinfourl(r.fp, r.msg, req.get_full_url())
!         resp.code = r.status
!         resp.msg = r.reason
!         return resp
  
  



More information about the Python-checkins mailing list