Skip to content

Commit a101406

Browse files
committed
Add news entry
1 parent b64e42b commit a101406

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Doc/library/subprocess.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,8 @@ Instances of the :class:`Popen` class have the following methods:
807807
waits for process termination when available:
808808

809809
- Linux ≥5.3 uses :func:`os.pidfd_open` + :func:`select.poll`
810-
- macOS and other BSD variants use :func:`select.kqueue`
810+
- macOS and other BSD variants use :func:`select.kqueue` +
811+
``KQ_FILTER_PROC`` + ``KQ_NOTE_EXIT``
811812
- Windows uses ``WaitForSingleObject``
812813

813814
If none of these mechanisms are available, the function falls back to a
@@ -819,7 +820,8 @@ Instances of the :class:`Popen` class have the following methods:
819820
*timeout* was added.
820821

821822
.. versionchanged:: 3.15
822-
use efficient event-driven implementation on Linux >= 5.3 and macOS / BSD.
823+
if *timeout* is not ``None``, use efficient event-driven implementation
824+
on Linux >= 5.3 and macOS / BSD.
823825

824826
.. method:: Popen.communicate(input=None, timeout=None)
825827

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:meth:`subprocess.Popen.wait`: when ``timeout`` is not ``None``, an efficient
2+
event-driven mechanism now waits for process termination, if available:
3+
4+
- Linux ≥5.3 uses :func:`os.pidfd_open` + :func:`select.poll`
5+
- macOS and other BSD variants use :func:`select.kqueue` + ``KQ_FILTER_PROC`` +
6+
``KQ_NOTE_EXIT``
7+
- Windows keep using ``WaitForSingleObject`` (unchanged)
8+
9+
If none of these mechanisms are available, the function falls back to the
10+
traditional busy loop (non-blocking call and short sleeps).
11+
12+
Patch by Giampaolo Rodola.

0 commit comments

Comments
 (0)