From 5362ebae4390aebddc4e9249d4917eb1939af16d Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Tue, 1 Aug 2017 17:31:04 -0400 Subject: [PATCH] allow existing directory in shutil.copytree This is a legacy thing that wasn't updated with https://docs.python.org/3/library/os.html#os.makedirs --- Lib/shutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/shutil.py b/Lib/shutil.py index bd4760f1a7409d..ebb6707525e92a 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -312,7 +312,7 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, else: ignored_names = set() - os.makedirs(dst) + os.makedirs(dst, exist_ok=True) errors = [] for name in names: if name in ignored_names: