Skip to content

Commit 84db4a9

Browse files
authored
closes bpo-34664: Only check file permission bits of newly created directories. (GH-9273)
1 parent 66755cb commit 84db4a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_os.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,8 @@ def test_mode(self):
11311131
self.assertTrue(os.path.exists(path))
11321132
self.assertTrue(os.path.isdir(path))
11331133
if os.name != 'nt':
1134-
self.assertEqual(stat.S_IMODE(os.stat(path).st_mode), 0o555)
1135-
self.assertEqual(stat.S_IMODE(os.stat(parent).st_mode), 0o775)
1134+
self.assertEqual(os.stat(path).st_mode & 0o777, 0o555)
1135+
self.assertEqual(os.stat(parent).st_mode & 0o777, 0o775)
11361136

11371137
def test_exist_ok_existing_directory(self):
11381138
path = os.path.join(support.TESTFN, 'dir1')

0 commit comments

Comments
 (0)