fix(__main__): --verbose progress goes to stderr (was stdout) #11

Merged
Sponge merged 1 commit from feature/dune-extract-verbose-stderr-fix into develop 2026-05-28 07:00:51 +00:00
Owner

Summary

Caught during the full test+validate sweep ("test and validate everything besides running the server"). --verbose progress lines printed to stdout while every other status line printed to stderr, so in 2>&1 | head the per-pak block appeared AFTER the "Wrote N files" footer.

Fix

# Before
progress = print if args.verbose else None
# After — wrapped lambda so verbose lines write to stderr too.
progress = (lambda *a, **k: print(*a, file=sys.stderr, **k)) if args.verbose else None

Keeps stdout free for any future piped-data use (none today, but the diff subcommand already writes to stdout when --output is absent, so stream separation matters).

Validated

DUNE_EXTRACT_SKIP_ROWS=1 DUNE_EXTRACT_SKIP_LOCALIZATION=1 \
    python3 -m dune_extract --verbose --categories Misc 2>&1 | head -10

Now prints PAK ... TIME + per-pak lines BEFORE FDI parse complete and Wrote N files, matching the natural order.

No regression

Flag still controls verbosity; non-verbose runs are unchanged (progress is None). Three-line diff.

## Summary Caught during the full test+validate sweep ("test and validate everything besides running the server"). `--verbose` progress lines printed to stdout while every other status line printed to stderr, so in `2>&1 | head` the per-pak block appeared AFTER the "Wrote N files" footer. ## Fix ```python # Before progress = print if args.verbose else None # After — wrapped lambda so verbose lines write to stderr too. progress = (lambda *a, **k: print(*a, file=sys.stderr, **k)) if args.verbose else None ``` Keeps stdout free for any future piped-data use (none today, but the `diff` subcommand already writes to stdout when `--output` is absent, so stream separation matters). ## Validated ``` DUNE_EXTRACT_SKIP_ROWS=1 DUNE_EXTRACT_SKIP_LOCALIZATION=1 \ python3 -m dune_extract --verbose --categories Misc 2>&1 | head -10 ``` Now prints `PAK ... TIME` + per-pak lines BEFORE `FDI parse complete` and `Wrote N files`, matching the natural order. ## No regression Flag still controls verbosity; non-verbose runs are unchanged (progress is `None`). Three-line diff.
Caught during the full test+validate sweep. `progress = print if
args.verbose else None` defaulted to stdout, while every other status
line in the pipeline writes to stderr. Result: in `2>&1 | head`, the
per-pak progress block appeared AFTER the "Wrote N files" footer
instead of interleaved with the FDI parse output, because stdout
flushes later than stderr.

Fix: wrap print in a stderr-writing lambda so progress lines flow in
order. Keeps stdout free for any future piped-data use (none today,
but the diff subcommand already writes to stdout when --output is
absent, so stream separation matters).

Validated:
  DUNE_EXTRACT_SKIP_ROWS=1 DUNE_EXTRACT_SKIP_LOCALIZATION=1 \
      python3 -m dune_extract --verbose --categories Misc 2>&1 | head -10
  -> now prints "PAK ... TIME" + per-pak lines BEFORE "FDI parse
     complete" and "Wrote N files", matching the natural order.

No regression — flag still controls verbosity; non-verbose runs are
unchanged (progress is None).
Sponge merged commit cb61cd4e6f into develop 2026-05-28 07:00:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Sponge/Dune-Awakening-Server-Tools!11
No description provided.