From d0594695465486457c7c2d48f7932a8ef380274d Mon Sep 17 00:00:00 2001 From: Matheus Hunsche Date: Fri, 24 Oct 2025 19:44:57 +0000 Subject: [PATCH] Fix(deploy): Restore third-party dependency packaging A refactoring from the deprecated distutils.dir_util.copy_tree to the modern shutil.copytree inadvertently broke the packaging of third-party dependencies. shutil.copytree fails by default if the destination directory exists, which prevented dependencies from being copied into the final deployment zip. This commit fixes the issue by adding the 'dirs_exist_ok=True' argument, available since Python 3.8, to the shutil.copytree call. This restores the original update/merge behavior and ensures all necessary dependencies are correctly included in the clusterfuzz_package.zip, resolving the ModuleNotFoundError at runtime. --- src/local/butler/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/local/butler/common.py b/src/local/butler/common.py index 3fcc685234b..02b26677909 100644 --- a/src/local/butler/common.py +++ b/src/local/butler/common.py @@ -497,4 +497,4 @@ def copy_if_newer(src, dst): def update_dir(src_dir, dst_dir): """Recursively copy from src_dir to dst_dir, replacing files but only if they're newer or don't exist.""" - shutil.copytree(src_dir, dst_dir, copy_function=copy_if_newer) + shutil.copytree(src_dir, dst_dir, copy_function=copy_if_newer, dirs_exist_ok=True)