From 5ace134b646dfb3a756859984236807a9ddd47aa Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Thu, 9 Jan 2020 15:24:51 +0100 Subject: [PATCH 1/2] add pathlib path resolve --- pype/plugins/global/publish/integrate_new.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index faade613f2..9bfaf2e417 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -7,6 +7,7 @@ import errno import pyblish.api from avalon import api, io from avalon.vendor import filelink +from pathlib import Path # this is needed until speedcopy for linux is fixed if sys.platform == "win32": from speedcopy import copyfile @@ -468,8 +469,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): Returns: None """ - src = os.path.normpath(src) - dst = os.path.normpath(dst) + src = Path(src).resolve() + dst = Path(dst).resolve() self.log.debug("Copying file .. {} -> {}".format(src, dst)) dirname = os.path.dirname(dst) @@ -490,6 +491,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): def hardlink_file(self, src, dst): dirname = os.path.dirname(dst) + src = Path(src).resolve() + dst = Path(dst).resolve() try: os.makedirs(dirname) except OSError as e: From b3321a92ee4c0b05df0bd3f08684fcd632696f80 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 9 Jan 2020 23:06:57 +0100 Subject: [PATCH 2/2] fix(global): pathlib changed to pathlib2 --- pype/plugins/global/publish/integrate_new.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pype/plugins/global/publish/integrate_new.py b/pype/plugins/global/publish/integrate_new.py index 9bfaf2e417..c2812880c7 100644 --- a/pype/plugins/global/publish/integrate_new.py +++ b/pype/plugins/global/publish/integrate_new.py @@ -7,7 +7,7 @@ import errno import pyblish.api from avalon import api, io from avalon.vendor import filelink -from pathlib import Path +from pathlib2 import Path # this is needed until speedcopy for linux is fixed if sys.platform == "win32": from speedcopy import copyfile @@ -469,8 +469,11 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): Returns: None """ + src = Path(src).resolve() - dst = Path(dst).resolve() + drive, _path = os.path.splitdrive(dst) + unc = Path(drive).resolve() + dst = str(unc / _path) self.log.debug("Copying file .. {} -> {}".format(src, dst)) dirname = os.path.dirname(dst)