Closed frankenjoe closed 8 months ago
I guess the easiest workaround is to capture OSError
and check if error message contains 'Invalid cross-device link'
. If this is the case we fallback to shutil.move()
.
This is a duplicate of https://github.com/audeering/audeer/issues/71, where you actually proposed more or less the same solution to solve the issue. So maybe it's time we tackle this ;)
Duplicate of #71
I run into
OSError: [Errno 18] Invalid cross-device link
when I usedaudeer.move()
to move a file to another file system. Under the hood we callos.rename()
, which indeed does not support moving between file systems:So I guess we should either document it or - if possible - use
shutil.move()
when files are not on the same file system.