From 51dcf65fd75aca17ea32c9c55548dc249a56ec65 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Thu, 23 May 2019 09:08:14 +0200 Subject: [PATCH] [Downloader] Fix problem with copying directory tree. (#2690) * fix(downloader): clear paths in `distutils.dir_util._path_created` before copying tree fix #2685 * style(downloader): add comment about PR --- redbot/cogs/downloader/installable.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redbot/cogs/downloader/installable.py b/redbot/cogs/downloader/installable.py index 143701a6a..772aec4a9 100644 --- a/redbot/cogs/downloader/installable.py +++ b/redbot/cogs/downloader/installable.py @@ -114,6 +114,8 @@ class Installable(RepoJSONMixin): if self._location.is_file(): copy_func = shutil.copy2 else: + # clear copy_tree's cache to make sure missing directories are created (GH-2690) + distutils.dir_util._path_created = {} copy_func = distutils.dir_util.copy_tree # noinspection PyBroadException