From 3ab87af69d61651a375ea4ad6add90ba366b2ca6 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Sun, 29 Mar 2026 06:08:45 +0200 Subject: [PATCH] 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 97db7405a8bbef..d786aac3aede9f 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -567,7 +567,6 @@ def test_args_from_interpreter_flags(self): ['-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 @@ def test_args_from_interpreter_flags(self): 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'])