@@ -1383,21 +1383,14 @@ def test_exist_ok_existing_regular_file(self):
1383
1383
@unittest .skipUnless (os .name == 'nt' , "requires Windows" )
1384
1384
def test_win32_mkdir_700 (self ):
1385
1385
base = support .TESTFN
1386
- path1 = os .path .join (support .TESTFN , 'dir1' )
1387
- path2 = os .path .join (support .TESTFN , 'dir2' )
1388
- # mode=0o700 is special-cased to override ACLs on Windows
1389
- # There's no way to know exactly how the ACLs will look, so we'll
1390
- # check that they are different from a regularly created directory.
1391
- os .mkdir (path1 , mode = 0o700 )
1392
- os .mkdir (path2 , mode = 0o777 )
1393
-
1394
- out1 = subprocess .check_output (["icacls.exe" , path1 ], encoding = "oem" )
1395
- out2 = subprocess .check_output (["icacls.exe" , path2 ], encoding = "oem" )
1396
- os .rmdir (path1 )
1397
- os .rmdir (path2 )
1398
- out1 = out1 .replace (path1 , "<PATH>" )
1399
- out2 = out2 .replace (path2 , "<PATH>" )
1400
- self .assertNotEqual (out1 , out2 )
1386
+ path = os .path .abspath (os .path .join (support .TESTFN , 'dir' ))
1387
+ os .mkdir (path , mode = 0o700 )
1388
+ out = subprocess .check_output (["cacls.exe" , path , "/s" ], encoding = "oem" )
1389
+ os .rmdir (path )
1390
+ self .assertEqual (
1391
+ out .strip (),
1392
+ f'{ path } "D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)"' ,
1393
+ )
1401
1394
1402
1395
def tearDown (self ):
1403
1396
path = os .path .join (support .TESTFN , 'dir1' , 'dir2' , 'dir3' ,
0 commit comments