From d6dec530cabed646b6f792c0b808bb7c9db31e1c Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Tue, 10 Feb 2026 17:51:38 +1100 Subject: [PATCH 1/2] gh-144648: Improve libproc usage in _remote_debugging Add a missing include and use proc_listpids rather than proc_listallpids, since it is functionally identical and more widely implemented. --- Modules/_remote_debugging/subprocess.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/_remote_debugging/subprocess.c b/Modules/_remote_debugging/subprocess.c index 2056217664a9ee..1b16dd8343f2a5 100644 --- a/Modules/_remote_debugging/subprocess.c +++ b/Modules/_remote_debugging/subprocess.c @@ -273,6 +273,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result) #if defined(__APPLE__) && TARGET_OS_OSX +#include #include static int @@ -283,7 +284,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result) pid_t *ppids = NULL; /* Get count of all PIDs */ - int n_pids = proc_listallpids(NULL, 0); + int n_pids = proc_listpids(PROC_ALL_PIDS, 0, NULL, 0); if (n_pids <= 0) { PyErr_SetString(PyExc_OSError, "Failed to get process count"); goto done; @@ -298,7 +299,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result) } /* Get actual PIDs */ - int actual = proc_listallpids(pid_list, buffer_size * sizeof(pid_t)); + int actual = proc_listpids(PROC_ALL_PIDS, 0, pid_list, buffer_size * sizeof(pid_t)); if (actual <= 0) { PyErr_SetString(PyExc_OSError, "Failed to list PIDs"); goto done; From ced68d1cd92286099eb870b9243d3c1a6fb619ec Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 08:00:23 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/macOS/2026-02-10-08-00-17.gh-issue-144648.KEuUXp.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/macOS/2026-02-10-08-00-17.gh-issue-144648.KEuUXp.rst diff --git a/Misc/NEWS.d/next/macOS/2026-02-10-08-00-17.gh-issue-144648.KEuUXp.rst b/Misc/NEWS.d/next/macOS/2026-02-10-08-00-17.gh-issue-144648.KEuUXp.rst new file mode 100644 index 00000000000000..5f8ba046f3571e --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2026-02-10-08-00-17.gh-issue-144648.KEuUXp.rst @@ -0,0 +1 @@ +Allowed _remote_debugging to build on more OS versions by using proc_listpids() rather than proc_listallpids().