[Scipy-svn] r3335 - trunk/scipy/io

scipy-svn@scip... scipy-svn@scip...
Thu Sep 20 00:48:39 CDT 2007


Author: jarrod.millman
Date: 2007-09-20 00:48:37 -0500 (Thu, 20 Sep 2007)
New Revision: 3335

Modified:
   trunk/scipy/io/path.py
Log:
resyncing with upstream release


Modified: trunk/scipy/io/path.py
===================================================================
--- trunk/scipy/io/path.py	2007-09-20 05:45:53 UTC (rev 3334)
+++ trunk/scipy/io/path.py	2007-09-20 05:48:37 UTC (rev 3335)
@@ -2,7 +2,7 @@
 
 Example:
 
-from neuroimaging.utils.path import path
+from path import path
 d = path('/home/guido/bin')
 for f in d.files('*.py'):
     f.chmod(0755)
@@ -11,18 +11,14 @@
 
 
 URL:     http://www.jorendorff.com/articles/python/path
-Author:  Jason Orendorff <jason.orendorff@gmail.com> (and others - see the url!)
-Date:    7 Mar 2004
+Author:  Jason Orendorff <jason.orendorff\x40gmail\x2ecom> (and others - see the url!)
+Date:    9 Mar 2007
 """
 
 
 # TODO
-#   - Tree-walking functions don't avoid symlink loops.  Matt Harrison sent me a patch for this.
-#   - Tree-walking functions can't ignore errors.  Matt Harrison asked for this.
-#
-#   - Two people asked for path.chdir().  This just seems wrong to me,
-#     I dunno.  chdir() is moderately evil anyway.
-#
+#   - Tree-walking functions don't avoid symlink loops.  Matt Harrison
+#     sent me a patch for this.
 #   - Bug in write_text().  It doesn't support Universal newline mode.
 #   - Better error message in listdir() when self isn't a
 #     directory. (On Windows, the error message really sucks.)
@@ -30,11 +26,12 @@
 #   - Add methods for regex find and replace.
 #   - guess_content_type() method?
 #   - Perhaps support arguments to touch().
-#   - Could add split() and join() methods that generate warnings.
 
+from __future__ import generators
+
 import sys, warnings, os, fnmatch, glob, shutil, codecs, md5
 
-__version__ = '2.1'
+__version__ = '2.2'
 __all__ = ['path']
 
 # Platform-specific support for path.owner
@@ -387,6 +384,7 @@
                     "Unable to list directory '%s': %s"
                     % (self, sys.exc_info()[1]),
                     TreeWalkWarning)
+                return
             else:
                 raise
 
@@ -437,6 +435,7 @@
                     "Unable to list directory '%s': %s"
                     % (self, sys.exc_info()[1]),
                     TreeWalkWarning)
+                return
             else:
                 raise
 
@@ -467,6 +466,7 @@
                     "Unable to list directory '%s': %s"
                     % (self, sys.exc_info()[1]),
                     TreeWalkWarning)
+                return
             else:
                 raise
 
@@ -476,12 +476,13 @@
                 isdir = not isfile and child.isdir()
             except:
                 if errors == 'ignore':
-                    return
+                    continue
                 elif errors == 'warn':
                     warnings.warn(
                         "Unable to access '%s': %s"
                         % (self, sys.exc_info()[1]),
                         TreeWalkWarning)
+                    continue
                 else:
                     raise
 



More information about the Scipy-svn mailing list