Fix read bytes count#463
Closed
z2v wants to merge 3 commits intoaio-libs:masterfrom
z2v:bug/wrong-read-bytes-count
Closed
Fix read bytes count#463z2v wants to merge 3 commits intoaio-libs:masterfrom z2v:bug/wrong-read-bytes-count
z2v wants to merge 3 commits intoaio-libs:masterfrom
z2v:bug/wrong-read-bytes-count
Conversation
`read` attempts to read *up to* `chunk_size` bytes. So real chunk length can be less than `chunk_size`.
tests/test_multipart.py
Outdated
Member
There was a problem hiding this comment.
I dislike the test.
Let's assume we will break the code again.
Looking on random test failures I'll have no clue what's broken.
Member
There was a problem hiding this comment.
Agree. Better see separate test function that reproduces that behaviour.
Member
|
@kxepal would you see the PR in 0.17.2 bugfix release? |
Member
|
Would be nice to have. |
Contributor
Author
tests/test_multipart.py
Outdated
Member
There was a problem hiding this comment.
You can use bytearray instead of list with further join.
Contributor
Author
|
Not sure about Travis failure reason. Locally test passes with Python 3.4.3. I'll rewrite stream object without inheritance later. |
Member
|
Fixed in 0.17 branch. |
Member
There was a problem hiding this comment.
should be return (yield from super().read(size)).
I've fixed it already.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
readattempts to read up tochunk_sizebytes. So real chunk length can be less thanchunk_size.