Skip to content

Commit b820532

Browse files
authored
Resolve path when symlinking layer and make_relative is False (#492)
* resolve path when symlinking layer and make_relative is False * update changelog
1 parent 8af8141 commit b820532

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section
1818

1919
### Changed
2020
- Improved performance for calculations with `Vec3Int` and `BoundingBox`. [#461](https://github.com/scalableminds/webknossos-libs/pull/461)
21+
- 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)
2122

2223
### Fixed
2324

webknossos/webknossos/dataset/dataset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def add_symlink_layer(
411411
foreign_layer_symlink_path = (
412412
Path(os.path.relpath(foreign_layer_path, self.path))
413413
if make_relative
414-
else Path(os.path.abspath(foreign_layer_path))
414+
else foreign_layer_path.resolve()
415415
)
416416
os.symlink(foreign_layer_symlink_path, join(self.path, layer_name))
417417
original_layer = Dataset(foreign_layer_path.parent).get_layer(
@@ -443,7 +443,6 @@ def add_copy_layer(
443443
else:
444444
foreign_layer_path = Path(foreign_layer)
445445

446-
foreign_layer_path = Path(os.path.abspath(foreign_layer_path))
447446
foreign_layer_name = foreign_layer_path.name
448447
layer_name = (
449448
new_layer_name if new_layer_name is not None else foreign_layer_name

0 commit comments

Comments
 (0)