From d5fa437dfb50e2e47632cdc994e3257608688f30 Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sat, 26 Jul 2025 09:44:12 -0700 Subject: [PATCH 1/2] gh-126662: naming consistency for `signal.ItimerError` (#126712) --- Modules/signalmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 54bcd3270ef31a..c1c3d7c9c05534 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1623,7 +1623,7 @@ signal_module_exec(PyObject *m) modstate->ignore_handler = state->ignore_handler; // borrowed ref #ifdef PYHAVE_ITIMER_ERROR - modstate->itimer_error = PyErr_NewException("signal.itimer_error", + modstate->itimer_error = PyErr_NewException("signal.ItimerError", PyExc_OSError, NULL); if (modstate->itimer_error == NULL) { return -1; From a852c7bdd48979218a0c756ff1a5586d91cff607 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Sat, 26 Jul 2025 18:01:51 +0100 Subject: [PATCH 2/2] gh-131038: Use text=True in subprocesses in test_perf_profiler (#137117) --- Lib/test/test_perf_profiler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_perf_profiler.py b/Lib/test/test_perf_profiler.py index 7529c853f9c152..0207843cc0e8f7 100644 --- a/Lib/test/test_perf_profiler.py +++ b/Lib/test/test_perf_profiler.py @@ -318,6 +318,7 @@ def run_perf(cwd, *args, use_jit=False, **env_vars): stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, + text=True, ) if proc.returncode: print(proc.stderr, file=sys.stderr) @@ -327,10 +328,10 @@ def run_perf(cwd, *args, use_jit=False, **env_vars): jit_output_file = cwd + "/jit_output.dump" command = ("perf", "inject", "-j", "-i", output_file, "-o", jit_output_file) proc = subprocess.run( - command, stderr=subprocess.PIPE, stdout=subprocess.PIPE, env=env + command, stderr=subprocess.PIPE, stdout=subprocess.PIPE, env=env, text=True ) if proc.returncode: - print(proc.stderr) + print(proc.stderr, file=sys.stderr) raise ValueError(f"Perf failed with return code {proc.returncode}") # Copy the jit_output_file to the output_file os.rename(jit_output_file, output_file) @@ -342,10 +343,9 @@ def run_perf(cwd, *args, use_jit=False, **env_vars): stderr=subprocess.PIPE, env=env, check=True, + text=True, ) - return proc.stdout.decode("utf-8", "replace"), proc.stderr.decode( - "utf-8", "replace" - ) + return proc.stdout, proc.stderr class TestPerfProfilerMixin: