]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141442: Add escaping to iOS testbed arguments (#141443)
authorRussell Keith-Magee <russell@keith-magee.com>
Wed, 12 Nov 2025 21:41:26 +0000 (05:41 +0800)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 21:41:26 +0000 (05:41 +0800)
Xcode concatenates the test argument array, losing quoting in the process.

Apple/testbed/__main__.py
Misc/NEWS.d/next/Tools-Demos/2025-11-12-12-54-28.gh-issue-141442.50dS3P.rst [new file with mode: 0644]

index 42eb60a4c8dc02e972818123159463f4f6ac4b7e..49974cb142853ca6e2c20554e8617bb2d252e9f3 100644 (file)
@@ -2,6 +2,7 @@ import argparse
 import json
 import os
 import re
+import shlex
 import shutil
 import subprocess
 import sys
@@ -252,7 +253,7 @@ def update_test_plan(testbed_path, platform, args):
         test_plan = json.load(f)
 
     test_plan["defaultOptions"]["commandLineArgumentEntries"] = [
-        {"argument": arg} for arg in args
+        {"argument": shlex.quote(arg)} for arg in args
     ]
 
     with test_plan_path.open("w", encoding="utf-8") as f:
diff --git a/Misc/NEWS.d/next/Tools-Demos/2025-11-12-12-54-28.gh-issue-141442.50dS3P.rst b/Misc/NEWS.d/next/Tools-Demos/2025-11-12-12-54-28.gh-issue-141442.50dS3P.rst
new file mode 100644 (file)
index 0000000..073c070
--- /dev/null
@@ -0,0 +1 @@
+The iOS testbed now correctly handles test arguments that contain spaces.