]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118516: clarify that subprocess are automatically killed if transport gets garbage...
authorKumar Aditya <kumaraditya@python.org>
Thu, 6 Nov 2025 04:51:13 +0000 (10:21 +0530)
committerGitHub <noreply@github.com>
Thu, 6 Nov 2025 04:51:13 +0000 (10:21 +0530)
Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-subprocess.rst

index 0ccc7a2b4482ec7155fcdea384aad7f93d8b90d2..72f484fd1cbe7710d4b3c2cdc1eb7acff625da24 100644 (file)
@@ -1631,6 +1631,9 @@ async/await code consider using the high-level
    conforms to the :class:`asyncio.SubprocessTransport` base class and
    *protocol* is an object instantiated by the *protocol_factory*.
 
+   If the transport is closed or is garbage collected, the child process
+   is killed if it is still running.
+
 .. method:: loop.subprocess_shell(protocol_factory, cmd, *, \
                stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
                stderr=subprocess.PIPE, **kwargs)
@@ -1654,6 +1657,9 @@ async/await code consider using the high-level
    conforms to the :class:`SubprocessTransport` base class and
    *protocol* is an object instantiated by the *protocol_factory*.
 
+   If the transport is closed or is garbage collected, the child process
+   is killed if it is still running.
+
 .. note::
    It is the application's responsibility to ensure that all whitespace
    and special characters are quoted appropriately to avoid `shell injection
index 03e76bc868905eeebc67a1dd8850e4662023d0b7..9416c758e51d95d18854472d403f4f13bcf3fe17 100644 (file)
@@ -76,6 +76,9 @@ Creating Subprocesses
    See the documentation of :meth:`loop.subprocess_exec` for other
    parameters.
 
+   If the process object is garbage collected while the process is still
+   running, the child process will be killed.
+
    .. versionchanged:: 3.10
       Removed the *loop* parameter.
 
@@ -95,6 +98,9 @@ Creating Subprocesses
    See the documentation of :meth:`loop.subprocess_shell` for other
    parameters.
 
+   If the process object is garbage collected while the process is still
+   running, the child process will be killed.
+
    .. important::
 
       It is the application's responsibility to ensure that all whitespace and