Don't use shutil.move instead of osutils.rename
John A Meinel
john at arbash-meinel.com
Fri Dec 2 19:39:20 GMT 2005
Alexander Belchenko wrote:
> John A Meinel пишет:
>> I'm working on a patch in my win32 fixes branch, I just wanted to make a
>> comment about this change.
>>
>> At some point we used to use a fancy delete before rename on win32, and
>> someone changed that to shutil.move
>
> It's my fault when I was starting to work on win32 port in early 0.0.6
> days. I fix this in 0.0.9 and later that was published on my site,
> create the patch (#19) but my patches is very slowly merged into
> mainline so you finally found it and fix it yourself.
>
> Alexander
>
Have you had a chance to try my latest win32 branch? I fixed everything
so that all of the tests pass, though now it reports everything with
forward slashes. (And I haven't worked around the executable bit yet).
I would be happy to hear your feedback on the subject.
The shutil.move stuff isn't a big deal. I just wanted to make it public
knowledge that it is a non-atomic action.
I think the fancy rename stuff is better (rename the target out of the
way, and rename it back if something fails).
And it forced me to implement a real thing, rather than just the delete
+ rename. (sftp needed it anyway, since sftp doesn't support atomically
renaming over an existing file on any platform).
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051202/6c867046/attachment.pgp
More information about the bazaar
mailing list