Cannot stream large content from version 0.18.0 #1611
-
Starting from version 0.18.0, my code for downloading large data file via stream does not work. The code to download is taken straight from this example, except that the import tempfile
import httpx
with tempfile.NamedTemporaryFile() as download_file:
url = "https://speed.hetzner.de/100MB.bin"
with httpx.stream("GET", url, timeout=None) as response:
for chunk in response.iter_bytes():
download_file.write(chunk) This exact example works without problem, but when I start to fetch data around 500MB, I start to see timeout error. Notice that I also specify The error is as follow:
This error is consistent both on Linux and Mac in my case. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for raising this. I confirmed by downloading a large file, and then disconnecting wi-fi midway through the download. I've tracked this down to a bug introduced in this pull request #1577 and have now resolved in #1613. A new release should be incoming fairly shortly. |
Beta Was this translation helpful? Give feedback.
Thanks for raising this. I confirmed by downloading a large file, and then disconnecting wi-fi midway through the download.
And, as you say, the request then raised a timeout error after 5 seconds. (Despite the
timeout=None
parameter.)I've tracked this down to a bug introduced in this pull request #1577 and have now resolved in #1613. A new release should be incoming fairly shortly.