Skip to content

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#463
z2v wants to merge 3 commits intoaio-libs:masterfrom
z2v:bug/wrong-read-bytes-count

Conversation

@z2v
Copy link
Copy Markdown
Contributor

@z2v z2v commented Aug 11, 2015

read attempts to read up to chunk_size bytes. So real chunk length can be less than chunk_size.

`read` attempts to read *up to* `chunk_size` bytes. So real chunk length
can be less than `chunk_size`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Better see separate test function that reproduces that behaviour.

@asvetlov
Copy link
Copy Markdown
Member

@kxepal would you see the PR in 0.17.2 bugfix release?

@kxepal
Copy link
Copy Markdown
Member

kxepal commented Aug 11, 2015

Would be nice to have.

@z2v
Copy link
Copy Markdown
Contributor Author

z2v commented Aug 11, 2015

@asvetlov, @kxepal I've added test function for the case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use bytearray instead of list with further join.

@z2v
Copy link
Copy Markdown
Contributor Author

z2v commented Aug 11, 2015

Not sure about Travis failure reason. Locally test passes with Python 3.4.3. I'll rewrite stream object without inheritance later.

@asvetlov
Copy link
Copy Markdown
Member

Fixed in 0.17 branch.
@z2v thanks!

@asvetlov asvetlov closed this Aug 11, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be return (yield from super().read(size)).
I've fixed it already.

@z2v z2v deleted the bug/wrong-read-bytes-count branch August 12, 2015 09:12
@lock
Copy link
Copy Markdown

lock bot commented Oct 30, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants