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

BREAKING: eof errors if stream isn't readable #230

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

nhz2
Copy link
Member

@nhz2 nhz2 commented Jun 24, 2024

If the eof function returns false then it must be safe to read a byte.

If the stream is closed or otherwise not readable eof should throw an error to distinguish this from the case where the stream is empty. Ref: #170 (comment)

To get something kindof similar to the previous behavior of eof use !isreadable(stream) || eof(stream)

@nhz2 nhz2 marked this pull request as ready for review June 26, 2024 14:54
@nhz2 nhz2 requested a review from vtjnash June 26, 2024 14:54
@nhz2
Copy link
Member Author

nhz2 commented Jun 26, 2024

After this and #229 is merged I'll make a PR to update the version to 0.11

Copy link
Contributor

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

SGTM

@mkitti
Copy link
Member

mkitti commented Jun 26, 2024

Please provide guidance on how to migrate with the breaking change or at least provide further documentation on the change.

@nhz2
Copy link
Member Author

nhz2 commented Jun 26, 2024

Okay, I can add a section to the docs on how to update from 0.10 to 0.11. For most uses no changes should be needed.

@nhz2 nhz2 requested a review from mkitti June 26, 2024 23:38
docs/src/migrating.md Outdated Show resolved Hide resolved
docs/src/migrating.md Outdated Show resolved Hide resolved
Co-authored-by: Mark Kittisopikul <mkitti@users.noreply.github.com>
@nhz2 nhz2 merged commit 670ebca into master Jul 1, 2024
25 of 26 checks passed
@nhz2 nhz2 deleted the nz/eof-error-if-not-readable branch July 1, 2024 12:08
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.

3 participants