R. David Murray added the comment:

Since I spent some time thinking about this, I want to leave some notes:

The linux 'mv' command issues the following prompt:

  > mv t2/myfile t1
  mv: try to overwrite ‘t1/myfile’, overriding mode 0000 (---------)?

So modern linux, at least, will not overwrite the file unless the '-f' flag is 
given explicitly (or you answer yes to the prompt, but that's not relevant to 
shutil.move).

However, shutil.move does not claim to implement 'mv'.  The release note in 3.3 
indicates we've adapted its symlink handling to mimic mv, but the rest of the 
text is explicit about the implementation *in terms of other stdlib functions*.

So really the only way to understand the behavior of shutil.move is to 
understand what those other functions do on your platform.  The OP's confusion 
had to do with the behavior of *the Unix file system* in the face of a rename 
operation, not with the definition of shutil.move itself (which says that it 
uses rename, and links to its description).

Someone could think through the description of 'rename' and open an issue to 
improve *its* documentation if that seems warranted, but I think that "has 
permission" is somewhat platform dependent and so it probably isn't appropriate 
to change that doc, either.

Thus, I agree that this should be closed.

----------
nosy: +r.david.murray
resolution: rejected -> invalid
stage:  -> committed/rejected

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1076515>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to