diff -r 6af0535b5e3a Lib/test/test_shutil.py --- a/Lib/test/test_shutil.py Mon Jun 25 23:20:27 2012 +0100 +++ b/Lib/test/test_shutil.py Mon Jun 25 21:20:23 2012 -0700 @@ -1174,6 +1174,7 @@ # copytree returns its destination path. src_dir = self.mkdtemp() dst_dir = src_dir + "dest" + self.addCleanup(shutil.rmtree, dst_dir, True) src = os.path.join(src_dir, 'foo') write_file(src, 'foo') rv = shutil.copytree(src_dir, dst_dir) @@ -1184,6 +1185,7 @@ def setUp(self): self.temp_dir = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, self.temp_dir, True) # Give the temp_file an ".exe" suffix for all. # It's needed on Windows and not harmful on other platforms. self.temp_file = tempfile.NamedTemporaryFile(dir=self.temp_dir, @@ -1506,6 +1508,7 @@ # but a different case. self.src_dir = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, self.src_dir, True) dst_dir = os.path.join( os.path.dirname(self.src_dir), os.path.basename(self.src_dir).upper())