Skip to content

fix: handle downloads without Content-Length - #490

Closed
dancingcowboy wants to merge 1 commit into
binance:masterfrom
dancingcowboy:fix/missing-content-length
Closed

dancingcowboy wants to merge 1 commit into
binance:masterfrom
dancingcowboy:fix/missing-content-length

Conversation

@dancingcowboy

Copy link
Copy Markdown

Summary

  • use a fixed streaming block size when a response omits Content-Length
  • report downloaded bytes when a percentage cannot be calculated
  • add a regression test covering a response without the header

Without Content-Length, download_file previously used an uninitialized blocksize and assumed a known total while rendering progress. This can occur with chunked responses or intermediary proxies.

Validation

  • python3 -m unittest test_utility.py
  • python3 -m compileall -q .

@alplabin

alplabin commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Hi @dancingcowboy,
I will close this PR as it is a duplicate of PR #488.

@alplabin alplabin closed this Sep 9, 2026
@dancingcowboy
dancingcowboy deleted the fix/missing-content-length branch September 14, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants