fix(qa-tests): Bring back decoding of exception field
What changed, and why it matters
This is a tiny fix to a Bitcoin Core internal QA test script. A previous change tried to make a subprocess error message readable by enabling text mode, but Python still stores the output as bytes in TimeoutExpired exceptions. The patch adds an explicit .decode('utf-8') so the test's debug printout works instead of crashing with a bytes/string formatting error. It only affects test failure diagnostics, not live Bitcoin node code, wallets, consensus, or network behavior.
No security action needed. Treat as a normal test-framework bug fix.
Security signals we found
No security-relevant code change: test-only diagnostic formatting
No input from untrusted sources is processed
No memory safety, cryptographic, consensus, or networking code modified
Evidence from the diff
In test/functional/feature_framework_startup_failures.py, a TimeoutExpired exception’s e.output is decoded to UTF-8 before being interpolated into an f-string. subprocess.run(…, text=True) does not cause TimeoutExpired.output to be a str (CPython issue 87597), so the prior commit produced a TypeError when formatting bytes into the f-string. The patch restores the explicit decode that was removed. This is a test-only logging/diagnostic fix.
Changed components
test/functional/feature_framework_startup_failures.pyInspect captured patch +1 / −1
diff --git a/test/functional/feature_framework_startup_failures.py b/test/functional/feature_framework_startup_failures.py
index 43dbeae7..1fdeb083 100755
--- a/test/functional/feature_framework_startup_failures.py
+++ b/test/functional/feature_framework_startup_failures.py
@@ -49,7 +49,7 @@ class FeatureFrameworkStartupFailures(BitcoinTestFramework):
print("Unexpected child process timeout!\n"
"WARNING: Timeouts like this halt execution of TestNode logic, "
"meaning dangling bitcoind processes are to be expected.\n"
- f"<CHILD OUTPUT BEGIN>\n{e.output}\n<CHILD OUTPUT END>",
+ f"<CHILD OUTPUT BEGIN>\n{e.output.decode("utf-8")}\n<CHILD OUTPUT END>",
file=sys.stderr)
raise
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.