]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-131038: Use text=True in subprocesses in test_perf_profiler (#137117) ...
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Thu, 21 Aug 2025 14:18:35 +0000 (17:18 +0300)
committerGitHub <noreply@github.com>
Thu, 21 Aug 2025 14:18:35 +0000 (15:18 +0100)
gh-131038: Use text=True in subprocesses in test_perf_profiler (#137117)

(cherry picked from commit a852c7bdd48979218a0c756ff1a5586d91cff607)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Lib/test/test_perf_profiler.py

index b380e496a2d3cbb276237f4127ca37402c33c713..f673f4d78d59b2ce7d463f0c4291641931e545e7 100644 (file)
@@ -283,6 +283,7 @@ def run_perf(cwd, *args, **env_vars):
         stdout=subprocess.PIPE,
         stderr=subprocess.PIPE,
         env=env,
+        text=True,
     )
     if proc.returncode:
         print(proc.stderr)
@@ -295,10 +296,9 @@ def run_perf(cwd, *args, **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
 
 
 @unittest.skipUnless(perf_command_works(), "perf command doesn't work")