Skip to content

Commit b833aaf

Browse files
committed
docs: clarify returncode behavior for subprocess_exec vs subprocess_shell
Update asyncio.subprocess returncode documentation: - For create_subprocess_exec, negative values (-N) indicate termination by signal N (POSIX). - For create_subprocess_shell, the return code follows the invoked shell’s exit status (e.g. 128+N for signals in bash/sh).
1 parent fc0305a commit b833aaf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Doc/library/asyncio-subprocess.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,16 @@ their completion.
305305

306306
A ``None`` value indicates that the process has not terminated yet.
307307

308-
A negative value ``-N`` indicates that the child was terminated
309-
by signal ``N`` (POSIX only).
308+
For processes created with :func:`create_subprocess_exec`, a negative
309+
value ``-N`` indicates that the child was terminated by signal ``N``
310+
(POSIX only).
311+
312+
For processes created with :func:`create_subprocess_shell`, the
313+
return code reflects the exit status of the shell itself (e.g. ``/bin/sh``),
314+
which may map signals to codes such as ``128+N``. See the
315+
documentation of the shell (for example, the Bash manual's Exit Status)
316+
for details.
317+
310318

311319

312320
.. _asyncio-subprocess-threads:

0 commit comments

Comments
 (0)