https://github.com/python/cpython/commit/12272956f8dbf399578aebfe70cf9f1a89fcf884
commit: 12272956f8dbf399578aebfe70cf9f1a89fcf884
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: pablogsal <[email protected]>
date: 2026-11-21T13:16:07Z
summary:
[3.15] gh-155031: Report subprocess permission errors to the user (GH-155032)
(#162383)
Report permission errors from child profiler processes to the user instead of
discarding their standard error.
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]