]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-34664: Only check file permission bits of newly created directories. ...
authorBenjamin Peterson <benjamin@python.org>
Thu, 13 Sep 2018 19:00:14 +0000 (12:00 -0700)
committerGitHub <noreply@github.com>
Thu, 13 Sep 2018 19:00:14 +0000 (12:00 -0700)
Lib/test/test_os.py

index 0a8ba5cf95f12bbd6be4509002fbfb46c46db6a0..6dbc25561237ad07296c914a8b078f41d5d8767a 100644 (file)
@@ -1131,8 +1131,8 @@ class MakedirTests(unittest.TestCase):
             self.assertTrue(os.path.exists(path))
             self.assertTrue(os.path.isdir(path))
             if os.name != 'nt':
-                self.assertEqual(stat.S_IMODE(os.stat(path).st_mode), 0o555)
-                self.assertEqual(stat.S_IMODE(os.stat(parent).st_mode), 0o775)
+                self.assertEqual(os.stat(path).st_mode & 0o777, 0o555)
+                self.assertEqual(os.stat(parent).st_mode & 0o777, 0o775)
 
     def test_exist_ok_existing_directory(self):
         path = os.path.join(support.TESTFN, 'dir1')