From c0d5185918921dcfa67fd64cb5a011544eda7a74 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 12 Sep 2023 02:47:50 +0200 Subject: [PATCH] gh-109295: Fix test_os.test_access_denied() for TEMP=cwd Fix test_os.test_access_denied() when the TEMP environment variable is equal to the current working directory. Run the test using a different filename, since self.fname already exists in this case. --- Lib/test/test_os.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 99e9ed213e5615..34cd27b143f231 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -737,7 +737,7 @@ def test_access_denied(self): # denied. See issue 28075. # os.environ['TEMP'] should be located on a volume that # supports file ACLs. - fname = os.path.join(os.environ['TEMP'], self.fname) + fname = os.path.join(os.environ['TEMP'], self.fname + "_access") self.addCleanup(os_helper.unlink, fname) create_file(fname, b'ABC') # Deny the right to [S]YNCHRONIZE on the file to