mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488) (GH-118739)
This commit is contained in:
parent
4762b36540
commit
35c799d791
6 changed files with 103 additions and 2 deletions
|
@ -1743,6 +1743,18 @@ class MakedirTests(unittest.TestCase):
|
|||
self.assertRaises(OSError, os.makedirs, path, exist_ok=True)
|
||||
os.remove(path)
|
||||
|
||||
@unittest.skipUnless(os.name == 'nt', "requires Windows")
|
||||
def test_win32_mkdir_700(self):
|
||||
base = os_helper.TESTFN
|
||||
path = os.path.abspath(os.path.join(os_helper.TESTFN, 'dir'))
|
||||
os.mkdir(path, mode=0o700)
|
||||
out = subprocess.check_output(["cacls.exe", path, "/s"], encoding="oem")
|
||||
os.rmdir(path)
|
||||
self.assertEqual(
|
||||
out.strip(),
|
||||
f'{path} "D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)"',
|
||||
)
|
||||
|
||||
def tearDown(self):
|
||||
path = os.path.join(os_helper.TESTFN, 'dir1', 'dir2', 'dir3',
|
||||
'dir4', 'dir5', 'dir6')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue