From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 12 Nov 2025 22:15:34 +0000 (+0100) Subject: [3.14] gh-141442: Add escaping to iOS testbed arguments (GH-141443) (#141479) X-Git-Tag: v3.14.1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=431618042658e753f9b2edc2a197787882c09110;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-141442: Add escaping to iOS testbed arguments (GH-141443) (#141479) Xcode concatenates the test argument array, losing quoting in the process. (cherry picked from commit 558936bec1f1e0f8346063a8cb2b2782d085178e) Co-authored-by: Russell Keith-Magee --- diff --git a/Apple/testbed/__main__.py b/Apple/testbed/__main__.py index 42eb60a4c8dc..49974cb14285 100644 --- a/Apple/testbed/__main__.py +++ b/Apple/testbed/__main__.py @@ -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 index 000000000000..073c070413f7 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2025-11-12-12-54-28.gh-issue-141442.50dS3P.rst @@ -0,0 +1 @@ +The iOS testbed now correctly handles test arguments that contain spaces.