summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-04-04 17:55:56 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-04-04 17:55:56 (GMT)
commit511e222e0aa120e15632752613c96493dbe8a672 (patch)
tree20483a67d60a8990f62ee250c9dac5c69052f698 /Lib
parent18fc4e70f3cd18803fda01667dcc0d6bab9f9b25 (diff)
downloadcpython-511e222e0aa120e15632752613c96493dbe8a672.zip
cpython-511e222e0aa120e15632752613c96493dbe8a672.tar.gz
cpython-511e222e0aa120e15632752613c96493dbe8a672.tar.bz2
make temporary read-only files writable, so rmtree can remove them (#21128)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_argparse.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 25ba9e6..5c77ec8 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):