Skip to content

Commit 558936b

Browse files
authored
pythongh-141442: Add escaping to iOS testbed arguments (python#141443)
Xcode concatenates the test argument array, losing quoting in the process.
1 parent 35ed3e4 commit 558936b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Apple/testbed/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import os
44
import re
5+
import shlex
56
import shutil
67
import subprocess
78
import sys
@@ -252,7 +253,7 @@ def update_test_plan(testbed_path, platform, args):
252253
test_plan = json.load(f)
253254

254255
test_plan["defaultOptions"]["commandLineArgumentEntries"] = [
255-
{"argument": arg} for arg in args
256+
{"argument": shlex.quote(arg)} for arg in args
256257
]
257258

258259
with test_plan_path.open("w", encoding="utf-8") as f:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The iOS testbed now correctly handles test arguments that contain spaces.

0 commit comments

Comments
 (0)