sanitizer_report leaks a traceback when --summary cannot be written #12072
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-27T18:48:06Z.
What happens
tools/sanitizer_report.pyparses and summarizes the JUnit report inside its controlledOSError/XML/value-error boundary, but the optional--summaryappend happens afterward.On current
main, a valid passing JUnit report with--summarypointing into a nonexistent directory does this:FileNotFoundErrortraceback while opening the summary destination;Expected
Summary publication failures should be treated like the tool's other I/O failures: return code 2, a
sanitizer_report:diagnostic on stderr, no traceback, and no successful-looking report emitted to stdout when the requested summary publication failed.Proposed fix
Append
--summaryinside the existing controlled error block before writing the report to stdout. Add a regression using a missing summary parent directory that asserts return code 2, empty stdout, diagnostic stderr, and no traceback.Current candidate is one Python-tool commit on current
main; focused tests pass 22/22 on Windows Python 3.12, Windows Python 3.9, and WSL Python 3.12. Conventions, diff-check, and compileall pass.Full open-PR exact-file scan performed during discovery covered 1,358 open PRs and found none touching
tools/sanitizer_report.pyortools/tests/test_sanitizer_report.py. Fresh behavior searches also find no matching open PR or issue.I can take this. Candidate branch:
malekaifa/AnyPS5:fix/sanitizer-summary-write.AI-assisted: yes (OpenAI Codex).