INNER CODE UNIT · Python
_spawn
renezander030/capcut-cli · python/capcut/__init__.py:141
def _spawn(argv: List[str], *, input: Optional[str], timeout: Optional[float], cwd: Optional[str]) -> "subprocess.CompletedProcess[str]":
"""Run argv with stdout/stderr captured to temporary files, not pipes.
Large documents (``describe`` is >64 KiB) can be cut at the pipe buffer when the CLI
exits; the repository's own test helper captures to files for the same reason.
"""
with tempfile.TemporaryFile(mode="w+", encoding="utf-8", errors="replace") as out, tempfile.TemporaryFile(
mode="w+", encoding="utf-8", errors="replace"
) as err:
try:
proc = subprocess.run(
argv,
input=input,
stdout=out,
stderr=err,
text=True,
encoding="utf-8",
errors="replace",