From 11bdf7fc524196cb7ea824558199ade7752ccefd Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Fri, 20 Oct 2023 15:12:36 +0200 Subject: [PATCH] Do not follow symlink when we copy a directory. --- kiwixbuild/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiwixbuild/utils.py b/kiwixbuild/utils.py index d8b1361d..0c5d4ec0 100644 --- a/kiwixbuild/utils.py +++ b/kiwixbuild/utils.py @@ -101,7 +101,7 @@ def copy_tree(src, dst, post_copy_function=None): os.makedirs(dstdir, exist_ok=True) for f in files: dstfile = pj(dstdir, f) - shutil.copy2(pj(root, f), dstfile) + shutil.copy2(pj(root, f), dstfile, follow_symlinks=False) if post_copy_function is not None: post_copy_function(dstfile)