Issue 34664: test.test_os.MakedirTests.test_mode is too strict (original) (raw)

If TESTFN is in a directory with S_ISGID set in its mode, test_os will fail:

====================================================================== FAIL: test_mode (test.test_os.MakedirTests)

Traceback (most recent call last): File "/buildbot/buildarea/3.x.ware-alpine/build/Lib/test/test_os.py", line 1134, in test_mode self.assertEqual(stat.S_IMODE(os.stat(path).st_mode), 0o555) AssertionError: 1389 != 365

The problem is we're checking the entire file mode when we should just be checking the permission bits.