2010-07-21 08:37:23 |
Martin Packman |
description |
In r5192 the transform code was changed from using os.rename to osutils.rename which boils down to no change on nix, but to _win32_rename to fancy_rename on windows.
This made the following tests no longer pass on windows:
bt.test_transform.TestFileMover.test_file_mover_rollback
bt.test_transform.TestTreeTransform.test_rollback_on_directory_clash
bt.test_transform.TestTreeTransform.test_two_directories_clash
bt.test_transform.TestTreeTransform.test_two_directories_clash_finalize
The new test added in r5228 also fails:
bt.test_transform.TestTreeTransform.test_rename_fails
The particular issue seems to be a difference in directory renaming. Given two directories, d1 and d2, rename(d1, d2) behaviour is as follows:
On nix with os.rename:
d1 replaces d2, unless d2 has contents, in which case ENOTEMPTY is raised
On windows with os.rename
EEXIST is raised
On windows with osutils._win32_rename:
d1 is renamed to a temp name, d1 is renamed d2, and os.unlink throws EACCES
Need to never be using _win32_rename with directories, or teach it how to handle them. |
In r5192 the transform code was changed from using os.rename to osutils.rename which boils down to no change on nix, but to _win32_rename to fancy_rename on windows.
This made the following tests no longer pass on windows:
bt.test_transform.TestFileMover.test_file_mover_rollback
bt.test_transform.TestTreeTransform.test_rollback_on_directory_clash
bt.test_transform.TestTreeTransform.test_two_directories_clash
bt.test_transform.TestTreeTransform.test_two_directories_clash_finalize
The new test added in r5228 also fails:
bt.test_transform.TestTreeTransform.test_rename_fails
The particular issue seems to be a difference in directory renaming. Given two directories, d1 and d2, rename(d1, d2) behaviour is as follows:
On nix with os.rename:
d1 replaces d2, unless d2 has contents, in which case ENOTEMPTY is raised
On windows with os.rename
EEXIST is raised
On windows with osutils._win32_rename:
d2 is renamed to a temp name, d1 is renamed d2, and os.unlink throws EACCES
Need to never be using _win32_rename with directories, or teach it how to handle them. |
|