[issue28490] inappropriate OS.Error "Invalid cross-device link"

Steve Newcomb report at bugs.python.org
Thu Oct 20 14:03:19 EDT 2016


New submission from Steve Newcomb:

os.rename() raises OSError with a misleading message saying "cross-device" when no cross-device activity is involved.  

Here, running on Ubuntu 16.04.1 using and ext4 filesystem, both filepaths are in the same filesystem, and the error is evidently due to the fact that a file already exists at the target path:

(Pdb) os.path.isfile( '/persist/nobackup/backupDisks/d38BasLijPupBak/d38-backup.20161020/d38-_,.,_home2_,.,_rack/.Xauthority')
True
(Pdb) os.path.isfile( '/persist/nobackup/backupDisks/d38BasLijPupBak/d38-20161020/home2/rack/.Xauthority')
True
(Pdb) os.rename( '/persist/nobackup/backupDisks/d38BasLijPupBak/d38-backup.20161020/d38-_,.,_home2_,.,_rack/.Xauthority', '/persist/nobackup/backupDisks/d38BasLijPupBak/d38-20161020/home2/rack/.Xauthor\
ity')
*** OSError: [Errno 18] Invalid cross-device link: '/persist/nobackup/backupDisks/d38BasLijPupBak/d38-backup.20161020/d38-_,.,_home2_,.,_rack/.Xauthority' -> '/persist/nobackup/backupDisks/d38BasLijPup\
Bak/d38-20161020/home2/rack/.Xauthority'

----------
components: IO
messages: 279061
nosy: steve.newcomb
priority: normal
severity: normal
status: open
title: inappropriate OS.Error "Invalid cross-device link"
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28490>
_______________________________________


More information about the Python-bugs-list mailing list