Eryk Sun <[email protected]> added the comment:
> It's nice if os.rename() can be atomic.
How about fixing the behavior in shutil.move()? Currently it tries
os.rename(src, dst) without checking for this case. For example:
>>> os.path.samefile('src', 'dst')
True
>>> shutil.move('src', 'dst')
'dst'
>>> os.path.exists('src')
True
>>> os.stat('src').st_nlink
2
---
Note that there's nothing to fix, and not much to document in Windows. It works
as expected. A slight difference from the general case is that os.replace() is
required only when replacing a different file, not a hard link for the same
file.
----------
nosy: +eryksun
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue21876>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com