diff --git a/scripts/gdl-sync.py b/scripts/gdl-sync.py index d7e2460..4a44243 100755 --- a/scripts/gdl-sync.py +++ b/scripts/gdl-sync.py @@ -484,6 +484,13 @@ def publish(staging: Path, dest: str, dry_run: bool) -> int: def main() -> int: + # A sync runs for hours and is normally watched through a redirected log, + # where Python's block buffering would withhold progress until it happened + # to flush -- and the gallery-dl subprocesses write to the same descriptor + # unbuffered, so the log would also interleave out of order. + sys.stdout.reconfigure(line_buffering=True) + sys.stderr.reconfigure(line_buffering=True) + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) ap.add_argument("--index", required=True,