]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-118516: clarify that subprocess are automatically killed if transport gets...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 6 Nov 2025 05:05:01 +0000 (21:05 -0800)
committerGitHub <noreply@github.com>
Thu, 6 Nov 2025 05:05:01 +0000 (10:35 +0530)
gh-118516: clarify that subprocess are automatically killed if transport gets garbage collected (GH-140997)
(cherry picked from commit 101c9c0a2187940900f684086cb9ba0d456fda49)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-subprocess.rst

index 54103a438c85539ec4e1d89620230d5f24bb4f9f..bb423d3aaa9e7a4d052165ad5971f6e7c0c348da 100644 (file)
@@ -1608,6 +1608,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)
@@ -1631,6 +1634,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 0828607b61d1ee4f4102a88dcefbce4db899d6b1..7ac9aa724ce0f896e56a97192ed4e942b38c3a4f 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