From: Benjamin Peterson Date: Thu, 13 Sep 2018 19:00:14 +0000 (-0700) Subject: closes bpo-34664: Only check file permission bits of newly created directories. ... X-Git-Tag: v3.8.0a1~1007 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84db4a9978069a98978e9cd7951d1a01d47e5286;p=thirdparty%2FPython%2Fcpython.git closes bpo-34664: Only check file permission bits of newly created directories. (GH-9273) --- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 0a8ba5cf95f1..6dbc25561237 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -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')