diff -r 42078214384c Lib/test/regrtest.py --- a/Lib/test/regrtest.py Mon Apr 06 00:27:42 2009 -0700 +++ b/Lib/test/regrtest.py Mon Apr 06 12:25:50 2009 -0700 @@ -677,7 +677,11 @@ continue if os.path.isdir(name): - kind, nuker = "directory", shutil.rmtree + def nukedir(name): + if hasattr(os, "chmod") and sys.platform[:6] != 'cygwin': + os.chmod(name, 0o700) + shutil.rmtree(name) + kind, nuker = "directory", nukedir elif os.path.isfile(name): kind, nuker = "file", os.unlink else: diff -r 42078214384c Lib/test/test_shutil.py --- a/Lib/test/test_shutil.py Mon Apr 06 00:27:42 2009 -0700 +++ b/Lib/test/test_shutil.py Mon Apr 06 12:25:50 2009 -0700 @@ -46,8 +46,8 @@ def check_args_to_onerror(self, func, arg, exc): if self.errorState == 0: - self.assertEqual(func, os.remove) - self.assertEqual(arg, self.childpath) + self.assertEqual(func, os.listdir) + self.assertEqual(arg, TESTFN) self.failUnless(issubclass(exc[0], OSError)) self.errorState = 1 else: