From a1be88e24d4a9e72f89c755026bb00a5cad59e97 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 31 Aug 2005 22:48:45 +0000 Subject: patch [ 1242454 ] shutil.copytree() quits too soon after an error. --- Lib/shutil.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/shutil.py b/Lib/shutil.py index baedd4c..14baa71 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -124,6 +124,10 @@ def copytree(src, dst, symlinks=False): # XXX What about devices, sockets etc.? except (IOError, os.error), why: errors.append((srcname, dstname, why)) + # catch the Error from the recursive copytree so that we can + # continue with other files + except Error, err: + errors.extend(err.args[0]) copystat(src, dst) if errors: raise Error, errors -- cgit v0.12