This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test.test_os.MakedirTests.test_mode is too strict
Type: Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, miss-islington
Priority: normal Keywords: patch

Created on 2018-09-13 18:22 by benjamin.peterson, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9273 merged benjamin.peterson, 2018-09-13 18:23
PR 9278 merged miss-islington, 2018-09-13 19:00
Messages (3)
msg325273 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-09-13 18:22
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.
msg325285 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-09-13 19:00
New changeset 84db4a9978069a98978e9cd7951d1a01d47e5286 by Benjamin Peterson in branch 'master':
closes bpo-34664: Only check file permission bits of newly created directories. (GH-9273)
https://github.com/python/cpython/commit/84db4a9978069a98978e9cd7951d1a01d47e5286
msg325290 - (view) Author: miss-islington (miss-islington) Date: 2018-09-13 19:42
New changeset b2a6aa32f34b6d77c15f175a9df7271a05519bf9 by Miss Islington (bot) in branch '3.7':
closes bpo-34664: Only check file permission bits of newly created directories. (GH-9273)
https://github.com/python/cpython/commit/b2a6aa32f34b6d77c15f175a9df7271a05519bf9
History
Date User Action Args
2022-04-11 14:59:05adminsetgithub: 78845
2018-09-13 19:42:31miss-islingtonsetnosy: + miss-islington
messages: + msg325290
2018-09-13 19:00:25miss-islingtonsetpull_requests: + pull_request8709
2018-09-13 19:00:19benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg325285

stage: patch review -> resolved
2018-09-13 18:23:58benjamin.petersonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request8705
2018-09-13 18:22:08benjamin.petersoncreate