From c888bf0a3ef1941d043601f2742fba89da2bfb73 Mon Sep 17 00:00:00 2001 From: Sofia Donato Ferreira Date: Fri, 31 Jul 2026 21:27:56 -0300 Subject: [PATCH 1/2] fix(tachyon): repass permission errors on subprocesses to parent / user These changes enable issues with permissions that happen while using the '--subprocesses' option on the 'run' method to propagate back, giving the user an indication of what went wrong. Previously, it would just silently fail, not giving the user a hint of what happened wrong. The `__main__` code was adjusted to streamline the `sys.exit` calls. Signed-off-by: Sofia Donato Ferreira --- Lib/profiling/sampling/__main__.py | 2 +- Lib/profiling/sampling/_child_monitor.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/profiling/sampling/__main__.py b/Lib/profiling/sampling/__main__.py index a45b645eae05fc4..c0e022ca4d0fa79 100644 --- a/Lib/profiling/sampling/__main__.py +++ b/Lib/profiling/sampling/__main__.py @@ -58,13 +58,13 @@ def handle_permission_error(): print(WINDOWS_PERMISSION_ERROR, file=sys.stderr) else: print(GENERIC_PERMISSION_ERROR, file=sys.stderr) - sys.exit(1) if __name__ == '__main__': try: main() except PermissionError: handle_permission_error() + sys.exit(1) except SamplingUnknownProcessError as err: print(f"Tachyon cannot find the process: {err}", file=sys.stderr) sys.exit(1) diff --git a/Lib/profiling/sampling/_child_monitor.py b/Lib/profiling/sampling/_child_monitor.py index ec56f75719f9d17..7c73ec26d88a33e 100644 --- a/Lib/profiling/sampling/_child_monitor.py +++ b/Lib/profiling/sampling/_child_monitor.py @@ -237,7 +237,6 @@ def _spawn_profiler_for_child(self, child_pid): cmd, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, ) with self._lock: if self._stop_event.is_set(): From 620339d4a506c0a66a44e54dee1f52a85ef9e382 Mon Sep 17 00:00:00 2001 From: Sofia Donato Ferreira Date: Sat, 1 Aug 2026 10:54:47 -0300 Subject: [PATCH 2/2] news: add NEWS entry for the fixed issue Signed-off-by: Sofia Donato Ferreira --- .../next/Library/2026-08-01-10-54-39.gh-issue-155031.sTB_n8.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-08-01-10-54-39.gh-issue-155031.sTB_n8.rst diff --git a/Misc/NEWS.d/next/Library/2026-08-01-10-54-39.gh-issue-155031.sTB_n8.rst b/Misc/NEWS.d/next/Library/2026-08-01-10-54-39.gh-issue-155031.sTB_n8.rst new file mode 100644 index 000000000000000..954e4cc2e54ac04 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-08-01-10-54-39.gh-issue-155031.sTB_n8.rst @@ -0,0 +1,2 @@ +Propagate to user any permission errors from subprocess attach commands in +Tachyon