py api: path_reference_copy() use try/except when copying images, can fail for odd reasons (currently fails if the dest dir is a symlink and not using expected permissions).

This commit is contained in:
Campbell Barton
2013-04-10 12:16:27 +00:00
parent 44a661e6a8
commit 791815c9d4

View File

@@ -436,8 +436,18 @@ def path_reference_copy(copy_set, report=print):
pass
else:
dir_to = os.path.dirname(file_dst)
os.makedirs(dir_to, exist_ok=True)
shutil.copy(file_src, file_dst)
try:
os.makedirs(dir_to, exist_ok=True)
except:
import traceback
traceback.print_exc()
try:
shutil.copy(file_src, file_dst)
except:
import traceback
traceback.print_exc()
def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."):