Skip to content

Commit 29aa2ba

Browse files
committed
FIX: Fallback to copy=True on symlink failure
1 parent 16f830f commit 29aa2ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nipype/utils/filemanip.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ def copyfile(originalfile, newfile, copy=False, create_new=False,
259259
if newhash != orighash:
260260
os.unlink(newfile)
261261
if (newhash is None) or (newhash != orighash):
262-
os.symlink(originalfile, newfile)
262+
try:
263+
os.symlink(originalfile, newfile)
264+
except OSError:
265+
return copyfile(originalfile, newfile, True, create_new,
266+
hashmethod, use_hardlink)
263267
else:
264268
if newhash:
265269
if hashmethod == 'timestamp':

0 commit comments

Comments
 (0)