Skip to content

Commit e6623e6

Browse files
committed
Use our own filename
1 parent d60ed78 commit e6623e6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Lib/test/test_os.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,7 @@ def test_stat_unlink_race(self):
30873087

30883088
@support.requires_subprocess()
30893089
def test_stat_inaccessible_file(self):
3090-
filename = os.path.abspath(os_helper.TESTFN)
3090+
filename = os.path.abspath("test_stat_inaccessible_file.txt")
30913091
ICACLS = os.path.expandvars(r"%SystemRoot%\System32\icacls.exe")
30923092

30933093
with open(filename, "wb") as f:
@@ -3123,11 +3123,6 @@ def cleanup():
31233123

31243124
self.addCleanup(cleanup)
31253125

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-
31313126
if support.verbose:
31323127
print("File:", filename)
31333128
print("stat with access:", stat1)
@@ -3139,6 +3134,11 @@ def cleanup():
31393134
if support.verbose:
31403135
print(" without access:", stat2)
31413136

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+
31423142
# We cannot get st_dev/st_ino, so ensure those are 0 or else our test
31433143
# is not set up correctly
31443144
self.assertEqual(0, stat2.st_dev)

0 commit comments

Comments
 (0)