Skip to content
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

fix: really attempt to return _all_ bytes if plain read called #5

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

michalc
Copy link
Member

@michalc michalc commented Sep 1, 2024

The previous behaviour limits a single read to 2^63 - 1 bytes, even if all are requested. However, this is wrong. If all are requested all should be returned.

There is a (strong!) possibility that more bytes than 2^63 - 1 cannot be allocated. But then this is a reason that the function should error - it should not behave as though 2^63 - 1 bytes is the entire stream.

This is probably all academic... I suspect there isn't a system around running Python that could come close to allocating 2^63 - 1 bytes.

The previous behaviour limits a single read to 2^63 - 1 bytes, even if all are
requested. However, this is wrong. If all are requested all should be returned.

There is a (strong!) possibility that more bytes than 2^63 - 1 cannot be
allocated. But then this is a reason that the function should error - it should
not behave as though 2^63 - 1 bytes is the entire stream.

This is probably all academic... I suspect there isn't a system around running
Python that could come close to allocating 2^63 - 1 bytes.
@michalc michalc force-pushed the fix/really-return-all-if-no-size branch from c395c18 to 65c8f87 Compare September 1, 2024 16:45
@michalc michalc merged commit c5f7810 into main Sep 1, 2024
6 checks passed
@michalc michalc deleted the fix/really-return-all-if-no-size branch September 1, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant