[MERGE] More than double the speed of "bzr selftest"

Alexander Belchenko bialix at ukr.net
Wed Apr 11 07:57:57 BST 2007

Alexander Belchenko has voted -0.
Status is now: Conditionally approved
Don't use shutil.rmtree if you don't want make my win32 life harder!
Even osutils.rmtree don't help in situation when some testing server is 
hang or raise exception: in this case it hold open testing directory and 
prevent to delete it with Permission denied error raised as well.

So, either make this rmtree conditional on win32, or provide full guard 
code for win32, that I recently extract in separate function in my last 

+def _rmtree_temp_dir(dirname):
+    try:
+        osutils.rmtree(dirname)
+    except OSError, e:
+        if sys.platform == 'win32' and e.errno == errno.EACCES:
+            print >>sys.stderr, ('Permission denied: '
+                                 'unable to remove testing dir '
+                                 '%s' % os.path.basename(test_root))
+        else:
+            raise

For details, see: 

More information about the bazaar mailing list