@@ -1800,21 +1800,14 @@ def test_exist_ok_existing_regular_file(self):
18001800 @unittest .skipUnless (os .name == 'nt' , "requires Windows" )
18011801 def test_win32_mkdir_700 (self ):
18021802 base = os_helper .TESTFN
1803- path1 = os .path .join (os_helper .TESTFN , 'dir1' )
1804- path2 = os .path .join (os_helper .TESTFN , 'dir2' )
1805- # mode=0o700 is special-cased to override ACLs on Windows
1806- # There's no way to know exactly how the ACLs will look, so we'll
1807- # check that they are different from a regularly created directory.
1808- os .mkdir (path1 , mode = 0o700 )
1809- os .mkdir (path2 , mode = 0o777 )
1810-
1811- out1 = subprocess .check_output (["icacls.exe" , path1 ], encoding = "oem" )
1812- out2 = subprocess .check_output (["icacls.exe" , path2 ], encoding = "oem" )
1813- os .rmdir (path1 )
1814- os .rmdir (path2 )
1815- out1 = out1 .replace (path1 , "<PATH>" )
1816- out2 = out2 .replace (path2 , "<PATH>" )
1817- self .assertNotEqual (out1 , out2 )
1803+ path = os .path .abspath (os .path .join (os_helper .TESTFN , 'dir' ))
1804+ os .mkdir (path , mode = 0o700 )
1805+ out = subprocess .check_output (["cacls.exe" , path , "/s" ], encoding = "oem" )
1806+ os .rmdir (path )
1807+ self .assertEqual (
1808+ out .strip (),
1809+ f'{ path } "D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)"' ,
1810+ )
18181811
18191812 def tearDown (self ):
18201813 path = os .path .join (os_helper .TESTFN , 'dir1' , 'dir2' , 'dir3' ,
0 commit comments