Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Lib/test/test_tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ def test_read_only_directory(self):
with _inside_empty_temp_dir():
probe = os.path.join(tempfile.tempdir, 'probe')
if os.name == 'nt':
cmd = ['icacls', tempfile.tempdir, '/deny', 'Everyone:(W)']
#Use security identifier *S-1-1-0 instead
# of localized "Everyone" to not depend on the locale.
cmd = ['icacls', tempfile.tempdir, '/deny', '*S-1-1-0:(W)']
stdout = None if support.verbose > 1 else subprocess.DEVNULL
subprocess.run(cmd, check=True, stdout=stdout)
else:
Expand All @@ -355,7 +357,9 @@ def test_read_only_directory(self):
self.make_temp()
finally:
if os.name == 'nt':
cmd = ['icacls', tempfile.tempdir, '/grant:r', 'Everyone:(M)']
# Use security identifier *S-1-1-0 instead
# of localized "Everyone" to not depend on the locale.
cmd = ['icacls', tempfile.tempdir, '/grant:r', '*S-1-1-0:(M)']
subprocess.run(cmd, check=True, stdout=stdout)
else:
os.chmod(tempfile.tempdir, oldmode)
Expand Down
Loading