[issue34664] test.test_os.MakedirTests.test_mode is too strict

Benjamin Peterson report at bugs.python.org
Thu Sep 13 14:22:08 EDT 2018


New submission from Benjamin Peterson <benjamin at python.org>:

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.

----------
components: Tests
messages: 325273
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: test.test_os.MakedirTests.test_mode is too strict
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34664>
_______________________________________


More information about the Python-bugs-list mailing list