gh-118802: Fix ACL use in test for non-English Windows (GH-118831)

(cherry picked from commit 82acc5f211)

Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
Miss Islington (bot) 2024-05-09 15:41:15 +02:00 committed by GitHub
parent 0d626760a4
commit c0d257cc69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3176,9 +3176,8 @@ class Win32NtTests(unittest.TestCase):
self.skipTest("Unable to create inaccessible file")
def cleanup():
# Give delete permission. We are the file owner, so we can do this
# even though we removed all permissions earlier.
subprocess.check_output([ICACLS, filename, "/grant", "Everyone:(D)"],
# Give delete permission to the owner (us)
subprocess.check_output([ICACLS, filename, "/grant", "*WD:(D)"],
stderr=subprocess.STDOUT)
os.unlink(filename)