From c173e46a724b50d27416bbc169bf2a57fe68808c Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 10 Dec 2024 15:43:41 +0100 Subject: [PATCH] fix(python): do not follow symlinks when copying recursively in overlapping sites-package --- backend/windmill-worker/src/python_executor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index ecaaa1b9be..c047921ece 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -424,7 +424,7 @@ async fn postinstall( .ok_or(anyhow::anyhow!("Cannot convert OsString to String"))? .to_owned(); - if name == "bin" || name.contains("dist-info") { + if name == "bin" || name == "__pycache__" || name.contains("dist-info") { continue; } @@ -487,7 +487,7 @@ fn copy_dir_recursively(src: &Path, dst: &Path) -> windmill_common::error::Resul let src_path = entry.path(); let dst_path = dst.join(entry.file_name()); - if src_path.is_dir() { + if src_path.is_dir() && !src_path.is_symlink() { copy_dir_recursively(&src_path, &dst_path)?; } else { fs::copy(&src_path, &dst_path)?;