Repository navigation
rsc8_audio: send archive scan progress to stderr - #6776
Conversation
Keep the progress indicator on stderr so piping a long archive scan works with or without --quiet.
|
Tested
AI-assisted. No game files. |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
tools/rsc8_audio.py sends progress() output to stderr via file=sys.stderr and introduces PROGRESS_BYTES (2 GiB) for the reporting interval; the --quiet help now states stdout holds the JSON summary. tests/test_rsc8_audio.py patches the interval and asserts stdout parses as JSON while progress appears on stderr (and is empty under --quiet).
Why merge
On large archives the progress line was printed to stdout beside the JSON summary, so consumers could not parse one command's output without knowing to pass --quiet. With this change stdout is always clean JSON regardless of archive size.
Verdict: Approve
Summary
Why mergeOn large archives the progress line was printed to stdout beside the JSON summary, so consumers could not parse one command's output without knowing to pass Verdict: Approve |
Claimed in the coordination issue as: four media-tool items on #6603,
rsc8_audioitem.What and why
Small scans printed a JSON summary, but at 2 GiB the progress line was also written to stdout. A consumer could not parse the same command’s output on a larger archive without knowing it needed
--quiet. Send progress to stderr and keep the JSON summary on stdout. The progress interval and quiet-mode behavior are unchanged.Tested
python3.12 -I tests/test_rsc8_audio.py: 38 passed.json.loads(stdout)returned a summary withspan == 2147483648, with one stderr update by default and empty stderr under--quiet. The small regression lowers the reporting interval instead of scanning 2 GiB in CI.git diff --checkandpython3.12 -I scripts/check_no_game_data.pyon the changed paths passed. Merge-tree trials: Clean against main and Protect RSC8 directory scan inputs from report overwrites #4017, rsc8_audio: fail on an unlistable sub-folder instead of silently skipping its banks #4355, rsc8_audio: the AWC start/end cue records matched into region pairs, record by record (ASSET-320) #5518, rsc8_audio: refuse a report path that is a directory or one of the scanned files #5608, Count cross-name AWC cue endpoint contacts per marker tag #6007 and rsc8_audio: find a bank whose magic straddles the --limit window end #6361. Protect RSC8 directory inputs from report overwrites #4110 already conflicts on the unchanged base.AI-assisted: yes.
Checklist