From 2037ced2f3440dcdd142eaaa2cc93023dd10c268 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Aug 2024 20:58:48 +1000 Subject: [PATCH] Fix error installing app-templates & legacy add-ons overwriting symlinks Resolve error when overwriting existing Python modules would attempt to recursively remove a symlink which raised an error. Related to #123827, same error but for extensions. --- scripts/startup/bl_operators/userpref.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/startup/bl_operators/userpref.py b/scripts/startup/bl_operators/userpref.py index 3b26cc3a663..22d93132bdb 100644 --- a/scripts/startup/bl_operators/userpref.py +++ b/scripts/startup/bl_operators/userpref.py @@ -48,7 +48,7 @@ def _module_filesystem_remove(path_base, module_name): f_base = os.path.splitext(f)[0] if f_base == module_name: f_full = os.path.join(path_base, f) - if os.path.isdir(f_full): + if os.path.isdir(f_full) and (not os.path.islink(f_full)): shutil.rmtree(f_full) else: os.remove(f_full)