0.8.11 UNRELEASED
+ IMPROVEMENTS
+
+ * Some fixes to help with porting to Python 3. (Yonggang Luo)
+
++ TESTS
++
++ * Remove readonly files properly in tests. (Yonggang Luo, #943131)
++
+ DOCUMENTATION
+
+ * Update documentation for building on Windows. (Yonggang Luo)
+
0.8.10 2012-01-23
BUG FIXES
)
-def force_rm_handle(remove_path, path, excinfo):
- os.chmod(
- path,
- os.stat(path).st_mode | stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH
- )
- remove_path(path)
-
++def rmtree_with_readonly(path):
++ """Simple wrapper for shutil.rmtree that can remove read-only files.
+
-def rmtree(path):
- """In Windows a read-only file cannot be removed, and shutil.rmtree fails.
- So we implement our own version of rmtree to address this issue.
++ In Windows a read-only file cannot be removed, and shutil.rmtree fails.
+ """
- if os.path.exists(path):
- shutil.rmtree(path, onerror=lambda func, path, e: force_rm_handle(func, path, e))
++ def force_rm_handle(remove_path, path, excinfo):
++ os.chmod(path, os.stat(path).st_mode | stat.S_IWUSR | stat.S_IWGRP |
++ stat.S_IWOTH)
++ remove_path(path)
++ shutil.rmtree(path, onerror=force_rm_handle)
+
+
class TestCase(unittest.TestCase):
"""Base test case.
def tearDown(self):
TestCase.tearDown(self)
os.chdir(self._oldcwd)
- shutil.rmtree(self.test_dir)
- rmtree(self.test_dir)
++ rmtree_with_readonly(self.test_dir)
class TestFileEditor(object):