]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-141442: Add escaping to iOS testbed arguments (GH-141443) (#141480)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 12 Nov 2025 22:03:51 +0000 (23:03 +0100)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 22:03:51 +0000 (22:03 +0000)
Xcode concatenates the test argument array, losing quoting in the process.
(cherry picked from commit 558936bec1f1e0f8346063a8cb2b2782d085178e)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Misc/NEWS.d/next/Tools-Demos/2025-11-12-12-54-28.gh-issue-141442.50dS3P.rst [new file with mode: 0644]
iOS/testbed/__main__.py

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.
index 6a4d9c76d162b4bd317abe8b1bcb70260d7b5da3..62a85a034ebd5f60e10d54e078c61c95326c4c81 100644 (file)
@@ -1,6 +1,7 @@
 import argparse
 import json
 import re
+import shlex
 import shutil
 import subprocess
 import sys
@@ -206,7 +207,7 @@ def update_test_plan(testbed_path, 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: