[Python-checkins] closes bpo-34664: Only check file permission bits of newly created directories. (GH-9273)

Miss Islington (bot) webhook-mailer at python.org
Thu Sep 13 15:42:31 EDT 2018


https://github.com/python/cpython/commit/b2a6aa32f34b6d77c15f175a9df7271a05519bf9
commit: b2a6aa32f34b6d77c15f175a9df7271a05519bf9
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-09-13T12:42:26-07:00
summary:

closes bpo-34664: Only check file permission bits of newly created directories. (GH-9273)

(cherry picked from commit 84db4a9978069a98978e9cd7951d1a01d47e5286)

Co-authored-by: Benjamin Peterson <benjamin at python.org>

files:
M Lib/test/test_os.py

diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 79ddc48eeb7d..cef4a09d7de9 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1131,8 +1131,8 @@ def test_mode(self):
             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')



More information about the Python-checkins mailing list