From: Benjamin Peterson Date: Fri, 4 Apr 2014 17:55:56 +0000 (-0400) Subject: make temporary read-only files writable, so rmtree can remove them (#21128) X-Git-Tag: v2.7.7rc1~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7ffb77e6f3a54a71b053b17147da5cec05a2b11;p=python make temporary read-only files writable, so rmtree can remove them (#21128) --- diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index a9b47b7c91..fdf2b67dc4 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -47,6 +47,9 @@ class TempDirMixin(object): def tearDown(self): os.chdir(self.old_dir) + for root, dirs, files in os.walk(self.temp_dir, topdown=False): + for name in files: + os.chmod(os.path.join(self.temp_dir, name), stat.S_IWRITE) shutil.rmtree(self.temp_dir, True) def create_readonly_file(self, filename):