Skip to content

Commit 98b66bb

Browse files
committed
test: build the broken-pipe worker commands as argv too
_exits_with quoted with shlex.quote, which is POSIX quoting: on Windows the quotes survive shlex.split(posix=False) and the interpreter is never found. Same fix as the worker-debug helper -- return argv, since no one string quoting convention works on both platforms.
1 parent e093613 commit 98b66bb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎tests/client/test_broken_pipe.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from __future__ import annotations
1111

12-
import shlex
1312
import sys
1413

1514
import pyarrow as pa
@@ -20,13 +19,14 @@
2019
from vgi.client.client import Client, ClientError
2120

2221

23-
def _exits_with(code: int) -> str:
24-
"""A worker command that exits immediately with ``code``, reading no input.
22+
def _exits_with(code: int) -> list[str]:
23+
"""Argv for a worker that exits immediately with ``code``, reading no input.
2524
26-
Spelled as a real process rather than the shell's ``exit`` builtin: workers are
27-
spawned without a shell, so a builtin would not resolve.
25+
A real process rather than the shell's ``exit`` builtin: workers are spawned
26+
without a shell, so a builtin would not resolve. Returned as argv because no
27+
one string quoting convention survives both POSIX and Windows.
2828
"""
29-
return f"{shlex.quote(sys.executable)} -c {shlex.quote(f'raise SystemExit({code})')}"
29+
return [sys.executable, "-c", f"raise SystemExit({code})"]
3030

3131

3232
def _make_test_batch() -> pa.RecordBatch:

0 commit comments

Comments
 (0)