The last read chunk can be less than chunk_size and the progress won't be reported in this case. My progress bar often stops near 99.7%/99.8%
for chunk in response.iter_content(chunk_size=chunk_size):
real_chunk += len(chunk)
if callable(progress_func) and real_chunk - chunk_size >= 0:
...
real_chunk = 0
...
So, I added an additional call after the loop.
if real_chunk > 0:
progress_func(bytes_read + real_chunk, file_size)
Hello.
The last read chunk can be less than chunk_size and the progress won't be reported in this case. My progress bar often stops near 99.7%/99.8%
So, I added an additional call after the loop.