]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-120164: Fix test_os.test_win32_mkdir_700() (GH-120177) (#120203)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 7 Jun 2024 09:35:08 +0000 (11:35 +0200)
committerGitHub <noreply@github.com>
Fri, 7 Jun 2024 09:35:08 +0000 (09:35 +0000)
gh-120164: Fix test_os.test_win32_mkdir_700() (GH-120177)

Don't compare the path to avoid encoding issues.

(cherry picked from commit d5ba4fc9bc9b2d9eff2a90893e8d500e0c367237)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Lib/test/test_os.py

index 88037059e96b9914d33265ae420f7ab4720cdf90..fdf5f3039255db7bf75935831c78269bf0a982f7 100644 (file)
@@ -1823,9 +1823,10 @@ class MakedirTests(unittest.TestCase):
         os.mkdir(path, mode=0o700)
         out = subprocess.check_output(["cacls.exe", path, "/s"], encoding="oem")
         os.rmdir(path)
+        out = out.strip().rsplit(" ", 1)[1]
         self.assertEqual(
-            out.strip(),
-            f'{path} "D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)"',
+            out,
+            '"D:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;OW)"',
         )
 
     def tearDown(self):