Confusing error for 'FileExists' during rename
John Arbash Meinel
john at arbash-meinel.com
Tue Dec 23 22:29:21 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
I just ran into this, though I'm not sure what the right answer is.
If you try to do "Transport.rename(source, target)" and target already
exists, it ends up raising:
It does this, because "_translate_error()" only allows one path to be
passed, and you could also get:
And we don't have a way to distinguish it.
I don't know that it really matters, but it was a bit confusing at
first. I would also imagine that it only really effects windows users,
because on Linux os.rename() for files would just auto-overwrite the
target. I would also propose that "pack.finish()" should actually be
using "transport.move()" which uses the fancy_rename dance to implement
near-POSIX (almost) atomic renames.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar