From 08283b491537550043dcc869ee1d5b13d89d26af Mon Sep 17 00:00:00 2001 From: Frederik Elwert Date: Sat, 28 Sep 2024 18:55:22 +0200 Subject: [PATCH] Fix symbolic link handling in `pelican-themes -s/-c` (#3392) --- pelican/tools/pelican_themes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index fa59b8fd..4d8cee2d 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -249,6 +249,7 @@ def install(path, v=False, u=False): def symlink(path, v=False): """Symbolically link a theme""" + path = os.path.realpath(path) if not os.path.exists(path): err(path + " : no such file or directory") elif not os.path.isdir(path): @@ -269,7 +270,7 @@ def symlink(path, v=False): def is_broken_link(path): """Returns True if the path given as is a broken symlink""" - path = os.readlink(path) + path = os.path.realpath(path) return not os.path.exists(path)