[Python-checkins] CVS: python/dist/src/Lib posixpath.py,1.42,1.43

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 16 Apr 2001 11:12:07 -0700


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

Modified Files:
	posixpath.py 
Log Message:
In walk(), don't die when os.lstat() raises os.error, e.g. because a
file was deleted by a previous call to the visitor function.

This used to be the behavior in 1.5.2 and before, but a patch to avoid
making two stat() calls accidentally broke this in 2.0.

Moshe, this would be a good one for 2.0.1 too!


Index: posixpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/posixpath.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** posixpath.py	2001/02/12 02:00:42	1.42
--- posixpath.py	2001/04/16 18:12:04	1.43
***************
*** 270,274 ****
      for name in names:
          name = join(top, name)
!         st = os.lstat(name)
          if stat.S_ISDIR(st[stat.ST_MODE]):
              walk(name, func, arg)
--- 270,277 ----
      for name in names:
          name = join(top, name)
!         try:
!             st = os.lstat(name)
!         except os.error:
!             continue
          if stat.S_ISDIR(st[stat.ST_MODE]):
              walk(name, func, arg)