From b820532b71716449ab78b66b1d7ad4e0b21560df Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 29 Nov 2021 20:21:15 +0100 Subject: [PATCH] Resolve path when symlinking layer and make_relative is False (#492) * resolve path when symlinking layer and make_relative is False * update changelog --- webknossos/Changelog.md | 1 + webknossos/webknossos/dataset/dataset.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webknossos/Changelog.md b/webknossos/Changelog.md index 85ae857f5..8aa6b2cbe 100644 --- a/webknossos/Changelog.md +++ b/webknossos/Changelog.md @@ -18,6 +18,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section ### Changed - Improved performance for calculations with `Vec3Int` and `BoundingBox`. [#461](https://github.com/scalableminds/webknossos-libs/pull/461) +- Resolve path when symlinking layer and make_relative is False (instead of only making it absolute). [#492](https://github.com/scalableminds/webknossos-libs/pull/492) ### Fixed diff --git a/webknossos/webknossos/dataset/dataset.py b/webknossos/webknossos/dataset/dataset.py index 529821f35..5bcccfeae 100644 --- a/webknossos/webknossos/dataset/dataset.py +++ b/webknossos/webknossos/dataset/dataset.py @@ -411,7 +411,7 @@ def add_symlink_layer( foreign_layer_symlink_path = ( Path(os.path.relpath(foreign_layer_path, self.path)) if make_relative - else Path(os.path.abspath(foreign_layer_path)) + else foreign_layer_path.resolve() ) os.symlink(foreign_layer_symlink_path, join(self.path, layer_name)) original_layer = Dataset(foreign_layer_path.parent).get_layer( @@ -443,7 +443,6 @@ def add_copy_layer( else: foreign_layer_path = Path(foreign_layer) - foreign_layer_path = Path(os.path.abspath(foreign_layer_path)) foreign_layer_name = foreign_layer_path.name layer_name = ( new_layer_name if new_layer_name is not None else foreign_layer_name