fix(tools): handle unwritable summary destinations and reject aliased inputs in sanitizer_report #12433
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 pushkarreddyy on 2026-10-28T13:30:19Z.
Problem
tools/sanitizer_report.pyhas two file-handling defects:--summary:main()performs input report parsing inside atry ... except (OSError, ET.ParseError, ValueError)block, but writes--summaryoutside exception handling at lines 130–132 (with args.summary.open("a", encoding="utf-8") as summary:). When--summarypoints to a nonexistent directory, a directory path, or an unwritable path, it crashes with an unhandledFileNotFoundError,IsADirectoryError, orPermissionErrortraceback (exit 1) instead of exiting cleanly with return code 2 viasanitizer_report: <error>.--summaryis appended to without checking for aliases against the inputjunitreport XML or--knownfailures list. An aliased summary corrupts the input XML document with appended markdown.Solution
--summaryif it targetsargs.junitorargs.known.--summarywriting inside the existingtry ... exceptblock so write failures outputsanitizer_report: <error>and return 2.tools/tests/test_sanitizer_report.py.