]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-146004: fix test_args_from_interpreter_flags on windows (GH-146580) (#146585)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 29 Mar 2026 04:55:22 +0000 (06:55 +0200)
committerGitHub <noreply@github.com>
Sun, 29 Mar 2026 04:55:22 +0000 (04:55 +0000)
gh-146004: fix test_args_from_interpreter_flags on windows (GH-146580)
(cherry picked from commit 1af025dd2206eecee3ee6242f2a7cdb67173fb97)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
Lib/test/test_support.py

index 97db7405a8bbef915d1bed5db1322a630f400d6f..d786aac3aede9fdad0e611f3b3ae16697a8114be 100644 (file)
@@ -567,7 +567,6 @@ class TestSupport(unittest.TestCase):
             ['-X', 'int_max_str_digits=1000'],
             ['-X', 'lazy_imports=all'],
             ['-X', 'no_debug_ranges'],
-            ['-X', 'pycache_prefix=/tmp/pycache'],
             ['-X', 'showrefcount'],
             ['-X', 'tracemalloc'],
             ['-X', 'tracemalloc=3'],
@@ -576,6 +575,12 @@ class TestSupport(unittest.TestCase):
             with self.subTest(opts=opts):
                 self.check_options(opts, 'args_from_interpreter_flags')
 
+        with os_helper.temp_dir() as temp_path:
+            prefix = os.path.join(temp_path, 'pycache')
+            opts = ['-X', f'pycache_prefix={prefix}']
+            with self.subTest(opts=opts):
+                self.check_options(opts, 'args_from_interpreter_flags')
+
         self.check_options(['-I', '-E', '-s', '-P'],
                            'args_from_interpreter_flags',
                            ['-I'])