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.

作者 r.david.murray
收信人 Trundle, draghuram, eric.araujo, giampaolo.rodola, neologix, pitrou, r.david.murray, tarek, techtonik, vstinner
日期 2011-12-23.20:04:27
SpamBayes Score 2.7332776e-08
Marked as misclassified
Message-id <1324670668.55.0.655853819059.issue8828@psf.upfronthosting.co.za>
In-reply-to
内容
So maybe my warning idea isn't such a bad idea :)

As a unix programmer, I was very surprised to read in this thread that Windows doesn't overwrite the file on rename.  As a unix programmer, I don't check for errors on a rename, because I expect it to just work.  I'd like the windows rename call to stop throwing errors if the file exists, it breaks my programs if they run on windows.

(Actually, very few of my programs ever get run on Windows, but you get the idea.)

Thus, the only possible course is to maintain backward compatibility, and allow the programmers who care to specify the desired behavior.  Since one of the important aspects of 'rename' in unix programmers' minds is that it is atomic, a race condition is not acceptable, therefore overwrite=False is not an acceptable option for os.rename.
历史
日期 用户 动作 参数
2011-12-23 20:04:28r.david.murray修改recipients: + r.david.murray, pitrou, vstinner, draghuram, techtonik, giampaolo.rodola, tarek, eric.araujo, Trundle, neologix
2011-12-23 20:04:28r.david.murray修改messageid: <1324670668.55.0.655853819059.issue8828@psf.upfronthosting.co.za>
2011-12-23 20:04:27r.david.murray链接issue8828 messages
2011-12-23 20:04:27r.david.murray创建