Fix exception when having project on a mapped network drive in Windows

This commit is contained in:
Sybren A. Stüvel 2019-06-07 12:23:25 +02:00
parent a864ccdf70
commit 37fc7f467a

View File

@ -231,7 +231,12 @@ class Packer:
# The blendfile that we pack is generally not its own dependency, so # The blendfile that we pack is generally not its own dependency, so
# we have to explicitly add it to the _packed_paths. # we have to explicitly add it to the _packed_paths.
bfile_path = self.blendfile.absolute() 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._output_path = bfile_pp
self._progress_cb.pack_start() self._progress_cb.pack_start()