-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StreamReader.read truncates content #3926
Comments
The number of read bytes varies (
Could be related to my environment, let me know if you can reproduce. Or maybe it's just that I'm using the API incorrectly. |
It's not a bug. It's by design. It reads no more than |
@asvetlov, I had PR that fixes that issue. We can introduce parameter or another function like |
Long story short
Performing a GET request. Switched from
read()
tocontent.read(n=NUM_BYTES)
(the streaming API) in order to limit the number of bytes read. The content gets truncated: the number of bytes returned is less thanNUM_BYTES
.Expected behavior
Read up to
NUM_BYTES
.Actual behavior
The number of bytes returned is less than
NUM_BYTES
.Steps to reproduce
Run this script:
Your environment
Related issues
The text was updated successfully, but these errors were encountered: