From 27c55c5e43916c6277e7825363e489c100f0c381 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 15 Oct 2025 22:01:23 +0100 Subject: [PATCH] Commit --- Lib/test/test_site.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 32fcf3162e8efd..27ae3539b554ef 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -855,12 +855,15 @@ def get_excepted_output(self, *args): return 10, None def invoke_command_line(self, *args): - args = ["-m", "site", *args] + cmd_args = [] + if sys.flags.no_user_site: + cmd_args.append("-s") + cmd_args.extend(["-m", "site", *args]) with EnvironmentVarGuard() as env: env["PYTHONUTF8"] = "1" env["PYTHONIOENCODING"] = "utf-8" - proc = spawn_python(*args, text=True, env=env, + proc = spawn_python(*cmd_args, text=True, env=env, encoding='utf-8', errors='replace') output = kill_python(proc)