mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
remove directory mode check from makedirs (closes #21082)
This commit is contained in:
parent
b4be376d16
commit
ee5f1c13d1
4 changed files with 20 additions and 32 deletions
|
@ -579,7 +579,7 @@ class MakedirTests(unittest.TestCase):
|
|||
os.makedirs(path, mode)
|
||||
self.assertRaises(OSError, os.makedirs, path, mode)
|
||||
self.assertRaises(OSError, os.makedirs, path, mode, exist_ok=False)
|
||||
self.assertRaises(OSError, os.makedirs, path, 0o776, exist_ok=True)
|
||||
os.makedirs(path, 0o776, exist_ok=True)
|
||||
os.makedirs(path, mode=mode, exist_ok=True)
|
||||
finally:
|
||||
os.umask(old_mask)
|
||||
|
@ -606,9 +606,8 @@ class MakedirTests(unittest.TestCase):
|
|||
os.makedirs(path, mode, exist_ok=True)
|
||||
# remove the bit.
|
||||
os.chmod(path, stat.S_IMODE(os.lstat(path).st_mode) & ~S_ISGID)
|
||||
with self.assertRaises(OSError):
|
||||
# Should fail when the bit is not already set when demanded.
|
||||
os.makedirs(path, mode | S_ISGID, exist_ok=True)
|
||||
# May work even when the bit is not already set when demanded.
|
||||
os.makedirs(path, mode | S_ISGID, exist_ok=True)
|
||||
finally:
|
||||
os.umask(old_mask)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue