feat: stream par2 verify/repair progress to terminal#19
Merged
Conversation
par2cmdline paints its "Scanning: X%" progress with \r updates on a single line. The default `run()` streamer reads stdout line-by-line (blocking until \n), so those updates piled up invisibly — `verify` and `repair` showed no output for the ~20 min a 25 GB BD-R takes. Add a `passthrough=True` mode to `shell/runner.run()` that lets the child inherit our stdout/stderr directly, and switch par2.verify / par2.repair to use it. Result detection moves from stdout-string matching to par2cmdline's exit codes — 0/1/2 maps cleanly to VerifyResult OK/REPAIRABLE/BROKEN (manually verified against par2cmdline 0.8.x). SIGINT handling is unchanged: the child still shares our process group, and `_check_sigint` converts a -SIGINT return into KeyboardInterrupt the same way as the other modes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
passthrough=Truemode toshell/runner.run()that lets the child inherit stdout/stderr directly — needed for tools that paint progress via\r(par2 verify/repair: "Scanning: X%" rewrites a single line, which the default streamer would buffer until the next\n).tools.par2.verifyandtools.par2.repairto passthrough. Result detection moves off stdout-string matching ("All files are correct" / "Repair is required") onto par2cmdline's exit codes — 0/1/2 maps cleanly toVerifyResultOK/REPAIRABLE/BROKEN. Manually verified on par2cmdline 0.8.x.bd-archive verify(and the post-burn check insideburn) was a ~20 min black screen on a 25 GB BD-R. With it, the live percentage shows on the user's terminal exactly aspar2 verifywould print it standalone.Pairs naturally with #18 (which dropped the sha512 pass) but is independent — touches only
shell/runner.py,tools/par2.py, plus an AGENTS.md note. SIGINT handling is unchanged: child shares our process group,_check_sigintstill converts-SIGINTreturns intoKeyboardInterrupt.Test plan
ruff checkpasses on changed filesbd-archive verifyon a real BD-R and confirm the par2 percentage paints in place on the terminalbd-archive extracton a disc with a damaged slice and confirm par2 repair output streams live🤖 Generated with Claude Code