*** test_shutil.py 31 okt 2004 12:49:56 +0100 1.8 --- test_shutil.py 31 okt 2004 20:47:57 +0100 *************** *** 22,34 **** os.mkdir(TESTFN) f = open(os.path.join(TESTFN, 'a'), 'w') f.close() # Make TESTFN unwritable. ! os.chmod(TESTFN, stat.S_IRUSR) shutil.rmtree(TESTFN, onerror=self.check_args_to_onerror) # Make TESTFN writable again. ! os.chmod(TESTFN, stat.S_IRWXU) shutil.rmtree(TESTFN) def check_args_to_onerror(self, func, arg, exc): --- 22,35 ---- os.mkdir(TESTFN) f = open(os.path.join(TESTFN, 'a'), 'w') f.close() + oldmode = os.stat(TESTFN).st_mode # Make TESTFN unwritable. ! os.chmod(TESTFN, stat.S_IREAD) shutil.rmtree(TESTFN, onerror=self.check_args_to_onerror) # Make TESTFN writable again. ! os.chmod(TESTFN, oldmode) shutil.rmtree(TESTFN) def check_args_to_onerror(self, func, arg, exc):