https://github.com/python/cpython/commit/1822ff517a9030ea2a36b9512b13f2f0973df527
commit: 1822ff517a9030ea2a36b9512b13f2f0973df527
branch: main
author: sofia(fia) <[email protected]>
committer: pablogsal <[email protected]>
date: 2026-11-21T12:42:22Z
summary:

gh-155031: repass permission errors on subprocesses to parent / user (#155032)

files:
A Misc/NEWS.d/next/Library/2026-08-01-10-54-39.gh-issue-155031.sTB_n8.rst
M Lib/profiling/sampling/__main__.py
M Lib/profiling/sampling/_child_monitor.py

diff --git a/Lib/profiling/sampling/__main__.py 
b/Lib/profiling/sampling/__main__.py
index a45b645eae05fc..c0e022ca4d0fa7 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 ec56f75719f9d1..7c73ec26d88a33 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():
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 00000000000000..954e4cc2e54ac0
--- /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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to