]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-34664: Only check file permission bits of newly created directories. ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 13 Sep 2018 19:42:26 +0000 (12:42 -0700)
committerGitHub <noreply@github.com>
Thu, 13 Sep 2018 19:42:26 +0000 (12:42 -0700)
(cherry picked from commit 84db4a9978069a98978e9cd7951d1a01d47e5286)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
Lib/test/test_os.py

index 79ddc48eeb7d63fbc6574c992a60b74dc6536d50..cef4a09d7de994deed6e91f05aa94d26f23c1d0f 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')