From 6dd2c0ca4b626cc30e6a724f57645f2db026f6ab Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Tue, 20 Jan 2026 16:23:58 +0000 Subject: [PATCH] Fix `scripts/check_system_python.py` (#17629) ## Summary Fix a bug in #17533 which was auto-merged despite failures. ## Test Plan N/A (CI PR). --- scripts/check_system_python.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/check_system_python.py b/scripts/check_system_python.py index 090ed47fb..fb5df4f5e 100755 --- a/scripts/check_system_python.py +++ b/scripts/check_system_python.py @@ -82,11 +82,17 @@ if __name__ == "__main__": if args.check_path: process = subprocess.run( - ["python", "-c", "import sys; print(sys.executable)"], + [ + "python", + "-c", + "import os, sys; sys.stdout.buffer.write(os.fsencode(sys.executable))", + ], check=True, stdout=subprocess.PIPE, ) - system_python_path = os.path.normcase(os.path.normpath(process.stdout)) + system_python_path = os.path.normcase( + os.path.normpath(os.fsdecode(process.stdout)) + ) our_python_path = os.path.normcase(os.path.normpath(sys.executable)) if our_python_path != system_python_path: