write_unraisable_default prints through sys.stderr and the traceback module #56
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 375 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.355
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #56"
general
weight: 0.35
youknowone
PyError::write_unraisable_defaultwrites tosys.stderrand prints the exception with thetracebackmodule, followingerror.py write_unraisable_default, with the output rules oferrors.c write_unraisable_exc/write_unraisable_exc_file.sys.stderris read first. If thesysmodule or itsstderrattribute is missing, or the value isNone, nothing is printed and the object's__repr__is not called. There is no fallback to the host stderr.file.writecalls:- with an object: the message (default
Exception ignored in), then": ", then the object's repr (or<object repr() failed>), then the line end- without an object: the message followed by
":\n"- with no message and no object: no header, so the exception is the first line
An
extra_line(the cffionerrorreport) replaces the final newline, as inerror.py.traceback._print_exception_bltin(exc, file), throughdisplay_through_traceback_module, with the same stream the header went to.lib-python/3/traceback.py_print_exception_bltintakes an optional positionalfile(exc, file=None, /). The_PyErr_Displaycaller keeps the one-argument call.tracebackcannot be imported or the call raises,write_exception_from_partsrenders the exception with the supplied traceback onto the same stream.write_unraisable_defaultdoes not set__traceback__on the exception, sosys.__unraisablehook__leaves the exception unchanged. The signal wakeup-fd report and the cffionerrorreport install their traceback before the call, asformat_unraisable_vdoes.sys.stderrlookup and thefile.writecall were split out ofwrite_to_sys_stderrintowrite_bytes_to_file.Verification
On macOS arm64, dynasm, with LLBC re-extracted:
cargo test --all --no-default-features --features dynasm,cpyext,pyre-module --exclude majit-backend-wasm: passpyre/extra_tests/run.py --gated-only --dynasm-only: 194/194pyre/check.py --backend dynasm: 599 passed, 3 failed. The failures arerange_ctor_in_loop,getframe_loop_callee_on_frame_chainandstr_search_index_bounds, which fail the same way on current main.pyre/cpython_tests/run.py --filtertest_signal,test_sys,test_cmd_line_script,test_thread,test_threading,test_gc,test_weakref: no regressionssys.__unraisablehook__produces the same output as CPython 3.15.0, apart from object addresses. It covers each header case, a failing__repr__, a__repr__that replacessys.stderr,sys.stderr = None, a supplied traceback, and a__del__report, and records the individual writes.cargo check -p pyre-interpreter -p pyre-modulewithdynasm, with--no-default-features --features dynasm, and withsandbox,dynasm: passcargo check -p pyre-wasm --target wasm32-unknown-unknown --features wasm-host: pass🤖 Generated with Claude Code