]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
merge with 3.2
authorGeorg Brandl <georg@python.org>
Sat, 25 Aug 2012 08:12:47 +0000 (10:12 +0200)
committerGeorg Brandl <georg@python.org>
Sat, 25 Aug 2012 08:12:47 +0000 (10:12 +0200)
1  2 
Lib/shutil.py

diff --cc Lib/shutil.py
index a8b9f3f4cbb3541fce990f5468863f1023565039,ef29ae2303c25d8a67bb7910fc21ac7b4c68d235..5dc311e70dd80c040de03c31b036041e9ebbfd56
@@@ -332,13 -236,27 +332,13 @@@ def copytree(src, dst, symlinks=False, 
              # Copying file access times may fail on Windows
              pass
          else:
-             errors.extend((src, dst, str(why)))
+             errors.append((src, dst, str(why)))
      if errors:
          raise Error(errors)
 +    return dst
  
 -def rmtree(path, ignore_errors=False, onerror=None):
 -    """Recursively delete a directory tree.
 -
 -    If ignore_errors is set, errors are ignored; otherwise, if onerror
 -    is set, it is called to handle the error with arguments (func,
 -    path, exc_info) where func is os.listdir, os.remove, or os.rmdir;
 -    path is the argument to that function that caused it to fail; and
 -    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
 -    is false and onerror is None, an exception is raised.
 -
 -    """
 -    if ignore_errors:
 -        def onerror(*args):
 -            pass
 -    elif onerror is None:
 -        def onerror(*args):
 -            raise
 +# version vulnerable to race conditions
 +def _rmtree_unsafe(path, onerror):
      try:
          if os.path.islink(path):
              # symlinks to directories are forbidden, see bug #1669