Skip to content

Commit

Permalink
Fix #6 File buffer not flushed
Browse files Browse the repository at this point in the history
Download of small files fails with file size mismatch error.

The buffer of the download file was not flushed on download completion resulting in sporadic file size mismatch errors mostly on small file sizes.

Buffer is now flushed after the download.
  • Loading branch information
spcified authored and catlinman committed Nov 11, 2020
1 parent d0d61ea commit 1f86ead
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions campdown/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def download_file(url, output, name, force=False, verbose=False, silent=False, s

# Flush the output buffer so we can overwrite the same line.
sys.stdout.flush()
f.flush()

# Verify our download size for completion. Since the file sizes will
# not entirely match up because of possible ID3 tag differences or
Expand Down

0 comments on commit 1f86ead

Please sign in to comment.