diff -r 37794a002517 Lib/test/test_shutil.py --- a/Lib/test/test_shutil.py Sat May 25 11:33:13 2013 -0400 +++ b/Lib/test/test_shutil.py Sun May 26 09:51:55 2013 +0300 @@ -1338,9 +1338,13 @@ # Other platforms: shouldn't match in the current directory. self.assertIsNone(rv) + @unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0, + 'non-root user required') def test_non_matching_mode(self): # Set the file read-only and ask for writeable files. os.chmod(self.temp_file.name, stat.S_IREAD) + if os.access(self.temp_file.name, os.W_OK): + self.skipTest("can't set the file read-only") rv = shutil.which(self.file, path=self.dir, mode=os.W_OK) self.assertIsNone(rv)