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 asvetlov, docs@python, pitrou, r.david.murray
Date 2016-08-28.19:38:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472413115.19.0.52282610743.issue27886@psf.upfronthosting.co.za>
In-reply-to
Content
The existing docs are pretty clear on the difference: rename is only guaranteed to replace an existing file on unix (which I think means posix in this context), whereas replace always replaces the file, regardless of platform.

I'm actually surprised that rename is even part of the pathlib API, since its cross platform behavior is not consistent.  It also seems as though the replace docs are incorrect, since they imply directories are replaced, but the os docs say they are not.

The "this is a posix requirement" note in os.replace also seems imprecise.  Windows is not posix, so that note leaves me wondering if replace is atomic on Windows or not.  That should be clarified one way or another.

I think adding the cross platform note in the pathlib docs is reasonable, since it addresses the question of why there are two similar functions.
History
Date User Action Args
2016-08-28 19:38:35r.david.murraysetrecipients: + r.david.murray, pitrou, asvetlov, docs@python
2016-08-28 19:38:35r.david.murraysetmessageid: <1472413115.19.0.52282610743.issue27886@psf.upfronthosting.co.za>
2016-08-28 19:38:35r.david.murraylinkissue27886 messages
2016-08-28 19:38:35r.david.murraycreate