-
Notifications
You must be signed in to change notification settings - Fork 40
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
Disable short reads when chunked (fixes #28) #35
Disable short reads when chunked (fixes #28) #35
Conversation
When chunked transfer encoding is used, the size of the chunk is prepended to each chunk. When calling read1 on the raw file-pointer, this data is not stripped off and breaks the JSON formatting.
972921a
to
7b6323b
Compare
This seems like a good fix to merge. Thoughts @btubbs ? Sorry for all the pings recently, you are just the only one with write access as far as I can tell. Have you thought of moving some of these projects to an organization or giving write access to some others (e.g. anyone) so that PRs etc can be more or less managed w/o having to bother you as much? |
+1 @btubbs, what's preventing this from merging? It looks good to me too. Fixes the bug that forces me to use a very old version of this nice lib. |
No opposition to this fix per se, though I worry about there not being a test in the test suite on chunked encoding. We've had enough accidental breakages over the last year or so around optimizations and corner cases that I'd hate to have this in there without some assurance that the next PR won't break it. |
@btubbs I've started working on a test case for chunked encoding, however there are problems with using chunked encoding in practice that I think are going to make reliably testing this difficult. In particular, let's assume I have the following encoded data:
In this example, I've set the chunk size to 10 ( |
Checking - is this repo effectively dead? Seems like this fixes a critical bug but it still hasn't been integrated. |
@grantcurell thanks for pinging on this. I've merged it. |
Wanted to follow up - thanks again @TheSandDoctor. I was working this for a customer. They pulled the updated version and it worked like a champ. Really appreciate your efforts |
When chunked transfer encoding is used, the size of the chunk is prepended to each chunk. When calling read1 on the raw file-pointer, this data is not stripped off and breaks the JSON formatting.
I have successfully tested this with http://stream.pushshift.io/ which uses chunked encoding and was failing.