Repository navigation
Description
Summary
The annotated Sequence[str] accepts a bare executable path. Expanding that path treats each character as a separate argument and attempts to execute the leading slash of an absolute POSIX path.
Reproduction
-
From the tagged
libvtcheckout, install the locked development dependencies withuv sync --frozen --python 3.14 --all-groups --all-extras. Use the checkout root as the working directory. -
Save the following as
case.pyat the checkout root.
import asyncio
import sys
from libvt.aio import open_pty
async def main():
async with open_pty([sys.executable, "-c", "print('OK')"]) as run:
print("argv list:", (await run.wait_for("OK")).text)
try:
async with open_pty(sys.executable):
pass
except OSError as exc:
print("argv string:", type(exc).__name__, str(exc))
asyncio.run(main())- Run the case.
$ uv run --no-sync python case.pyExpected
The API accepts a single executable name as one argument or rejects the bare string before spawning, with guidance to pass [executable].
Actual
A list starts Python and prints OK. Supplying the same absolute executable path as a string raises PermissionError for /.
Environment
Tested versions
CPython 3.14.6 on Linux under WSL2 ARM64. Identical output on release v0.0.1a4 (09611e5) and trunk (0864aa2).
Evidence
Observed output
argv list: OK
argv string: PermissionError [Errno 13] Permission denied: '/'
Proposal
Define single-string argv behavior and validate it before opening a PTY. Add a typed positive example, a bare path and an empty sequence.
- Developer experience — An error points directly to the argument that needs changing.
- Immediate benefit — Eliminates misleading executable-permission reports for the filesystem root.
- Longer-term benefit — Sets an explicit command contract for future sync and async process interfaces.
- End-user experience — A first-time caller gets a useful explanation for a familiar subprocess call shape.
Activity
tony commentedon Dec 3, 2026
open_pty()now rejects a bare command string before allocating a PTY. The allocation guard confirms the error precedesopenpty(). Passing[executable]launches the real Linux child and the fixture receivesREADY. PR #165aio(fix[pty]): Reject bare command strings