Skip to content

Commit 6aeb0d5

Browse files
[3.13] pythongh-141442: Add escaping to iOS testbed arguments (pythonGH-141443) (python#141480)
Xcode concatenates the test argument array, losing quoting in the process. (cherry picked from commit 558936b) Co-authored-by: Russell Keith-Magee <[email protected]>
1 parent 7c62bd5 commit 6aeb0d5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
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.

iOS/testbed/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import argparse
22
import json
33
import re
4+
import shlex
45
import shutil
56
import subprocess
67
import sys
@@ -206,7 +207,7 @@ def update_test_plan(testbed_path, args):
206207
test_plan = json.load(f)
207208

208209
test_plan["defaultOptions"]["commandLineArgumentEntries"] = [
209-
{"argument": arg} for arg in args
210+
{"argument": shlex.quote(arg)} for arg in args
210211
]
211212

212213
with test_plan_path.open("w", encoding="utf-8") as f:

0 commit comments

Comments
 (0)