This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients BreamoreBoy, bbrazil, brett.cannon, brian.curtin, eric.araujo, groodt, jemfinch, jlgijsbers, loewis, pitrou, r.david.murray, tarek, tim.golden
Date 2013-03-10.20:32:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362947557.43.0.785097589556.issue1076515@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-03-10 20:32:37r.david.murraysetrecipients: + r.david.murray, loewis, brett.cannon, jlgijsbers, jemfinch, pitrou, tim.golden, tarek, eric.araujo, brian.curtin, BreamoreBoy, bbrazil, groodt
2013-03-10 20:32:37r.david.murraysetmessageid: <1362947557.43.0.785097589556.issue1076515@psf.upfronthosting.co.za>
2013-03-10 20:32:37r.david.murraylinkissue1076515 messages
2013-03-10 20:32:36r.david.murraycreate