From 1688da0f2748a3f0957a6520a2eb31b8a7ee4c49 Mon Sep 17 00:00:00 2001 From: EXPLOSION Date: Wed, 4 Sep 2024 07:12:33 +0900 Subject: [PATCH] Document paths in the docstring --- src/trio/_subprocess.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/trio/_subprocess.py b/src/trio/_subprocess.py index a6f1ee738..263225ffc 100644 --- a/src/trio/_subprocess.py +++ b/src/trio/_subprocess.py @@ -333,9 +333,10 @@ async def _open_process( bytes such as ``['ls', '-l', 'directory with spaces']``, where the first element names the executable to invoke and the other elements specify its arguments. With ``shell=True`` in the ``**options``, or on - Windows, ``command`` may alternatively be a string or bytes, which - will be parsed following platform-dependent :ref:`quoting rules - `. + Windows, ``command`` can be a string or bytes, which will be parsed + following platform-dependent :ref:`quoting rules + `. In all cases ``command`` can be a path or a + sequence of paths. stdin: Specifies what the child process's standard input stream should connect to: output written by the parent (``subprocess.PIPE``), nothing (``subprocess.DEVNULL``), @@ -369,6 +370,7 @@ async def _open_process( ) if os.name == "posix": + # TODO: how do paths and sequences thereof play with `shell=True`? if isinstance(command, (str, bytes)) and not options.get("shell"): raise TypeError( "command must be a sequence (not a string or bytes) if "