From e8a7db10cc98d8f82cc83cfb04f4e80dad5509ee Mon Sep 17 00:00:00 2001 From: Jenny Wong Date: Thu, 30 Oct 2025 14:55:55 +0000 Subject: [PATCH] Extract realpath before computing relative path --- ecbundle/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ecbundle/util.py b/ecbundle/util.py index 5417b02..84c8096 100644 --- a/ecbundle/util.py +++ b/ecbundle/util.py @@ -106,7 +106,9 @@ def symlink_force(target, link_name): # prefer relative symlink rather than absolute # check first if target is absolute or relative if os.path.isabs(target): - target = os.path.relpath(target, os.path.dirname(link_name)) + target = os.path.relpath( + os.path.realpath(target), os.path.realpath(os.path.dirname(link_name)) + ) try: os.symlink(target, link_name)