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: v3.4.1rc1~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=511e222e0aa120e15632752613c96493dbe8a672;p=thirdparty%2FPython%2Fcpython.git 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 25ba9e62d173..5c77ec89d0b0 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):