diff --git a/Lib/shutil.py b/Lib/shutil.py index b0576407e02ffb..389c8d6c9c20e1 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -501,7 +501,11 @@ def _copytree(entries, src, dst, symlinks, ignore, copy_function, # catch the Error from the recursive copytree so that we can # continue with other files except Error as err: - errors.extend(err.args[0]) + if isinstance(err.args[0], list): + # this is a recursive error + errors.extend(err.args[0]) + else: + errors.append((srcname, dstname, str(err))) except OSError as why: errors.append((srcname, dstname, str(why))) try: