[Python-checkins] python/dist/src/Lib urllib.py,1.142,1.143

gvanrossum@sourceforge.net gvanrossum@sourceforge.net
2002年4月14日 17:25:03 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv25476
Modified Files:
	urllib.py 
Log Message:
Fix from SF bug #541980 (Jacques A. Vidrine).
When os.stat() for a file raises OSError, turn it into IOError per
documentation.
Bugfix candidate.
Index: urllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -d -r1.142 -r1.143
*** urllib.py	4 Apr 2002 20:41:34 -0000	1.142
--- urllib.py	15 Apr 2002 00:25:01 -0000	1.143
***************
*** 414,418 ****
 host, file = splithost(url)
 localname = url2pathname(file)
! stats = os.stat(localname)
 size = stats.st_size
 modified = rfc822.formatdate(stats.st_mtime)
--- 414,421 ----
 host, file = splithost(url)
 localname = url2pathname(file)
! try:
! stats = os.stat(localname)
! except OSError, e:
! raise IOError(e.errno, e.strerror, e.filename)
 size = stats.st_size
 modified = rfc822.formatdate(stats.st_mtime)

AltStyle によって変換されたページ (->オリジナル) /