From 37fc7f467a051bc077b7cec4eb3f4d0d42396aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 7 Jun 2019 12:23:25 +0200 Subject: [PATCH] Fix exception when having project on a mapped network drive in Windows --- blender_asset_tracer/pack/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blender_asset_tracer/pack/__init__.py b/blender_asset_tracer/pack/__init__.py index 3c1f6e3..a3584a4 100644 --- a/blender_asset_tracer/pack/__init__.py +++ b/blender_asset_tracer/pack/__init__.py @@ -231,7 +231,12 @@ class Packer: # The blendfile that we pack is generally not its own dependency, so # we have to explicitly add it to the _packed_paths. bfile_path = self.blendfile.absolute() - bfile_pp = self._target_path / bfile_path.relative_to(self.project) + + # Both paths have to be resolved first, because this also translates + # network shares mapped to Windows drive letters back to their UNC + # notation. Only resolving one but not the other (which can happen + # with the abosolute() call above) can cause errors. + bfile_pp = self._target_path / bfile_path.resolve().relative_to(self.project.resolve()) self._output_path = bfile_pp self._progress_cb.pack_start()