diff -r 03df2c1c6892 Lib/test/test_argparse.py --- a/Lib/test/test_argparse.py Thu Apr 03 10:31:25 2014 -0400 +++ b/Lib/test/test_argparse.py Fri Apr 04 11:25:24 2014 +0300 @@ -47,6 +47,9 @@ 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): diff -r 03df2c1c6892 Lib/test/test_file.py --- a/Lib/test/test_file.py Thu Apr 03 10:31:25 2014 -0400 +++ b/Lib/test/test_file.py Fri Apr 04 11:25:24 2014 +0300 @@ -300,6 +300,7 @@ self.fail("readlines() after next() with empty buffer " "failed. Got %r, expected %r" % (line, testline)) # Reading after iteration hit EOF shouldn't hurt either + f.close() f = self.open(TESTFN, 'rb') try: for line in f: diff -r 03df2c1c6892 Lib/test/test_httpservers.py --- a/Lib/test/test_httpservers.py Thu Apr 03 10:31:25 2014 -0400 +++ b/Lib/test/test_httpservers.py Fri Apr 04 11:25:24 2014 +0300 @@ -335,6 +335,7 @@ response = self.request(self.tempdir_name + '/') self.check_status_and_reason(response, 404) os.chmod(self.tempdir, 0755) + f.close() def test_head(self): response = self.request(