@@ -3087,7 +3087,7 @@ def test_stat_unlink_race(self):
3087
3087
3088
3088
@support .requires_subprocess ()
3089
3089
def test_stat_inaccessible_file (self ):
3090
- filename = os .path .abspath (os_helper . TESTFN )
3090
+ filename = os .path .abspath ("test_stat_inaccessible_file.txt" )
3091
3091
ICACLS = os .path .expandvars (r"%SystemRoot%\System32\icacls.exe" )
3092
3092
3093
3093
with open (filename , "wb" ) as f :
@@ -3123,11 +3123,6 @@ def cleanup():
3123
3123
3124
3124
self .addCleanup (cleanup )
3125
3125
3126
- # Read permissions back. This will help diagnose in case of failure
3127
- out = subprocess .check_output ([ICACLS , filename ], stderr = subprocess .STDOUT )
3128
- if support .verbose :
3129
- print (out .decode ("oem" , "backslashreplace" ))
3130
-
3131
3126
if support .verbose :
3132
3127
print ("File:" , filename )
3133
3128
print ("stat with access:" , stat1 )
@@ -3139,6 +3134,11 @@ def cleanup():
3139
3134
if support .verbose :
3140
3135
print (" without access:" , stat2 )
3141
3136
3137
+ # Read permissions back. This will help diagnose in case of failure
3138
+ out = subprocess .check_output ([ICACLS , filename ], stderr = subprocess .STDOUT )
3139
+ if support .verbose :
3140
+ print (out .decode ("oem" , "backslashreplace" ))
3141
+
3142
3142
# We cannot get st_dev/st_ino, so ensure those are 0 or else our test
3143
3143
# is not set up correctly
3144
3144
self .assertEqual (0 , stat2 .st_dev )
0 commit comments