Repository navigation
fix(protocol): raise on a short _read_unpack for every size (#2279) - #2349
Merged
Merged
Conversation
Problem: for a size with no struct format code, _read_unpack ran int.from_bytes on whatever arrived, so a short read returned a smaller integer where sizes 1, 2, 4 and 8 raise StructError. Fix: check the length on the int.from_bytes path and raise the same StructError without quiet; quiet still returns the partial value. Test: test_read_unpack_short_read_fails_for_every_size.
Owner
Author
|
Review: GOOD TO GO at
|
Contributor
|
Coverage: 91.58% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
Ready to merge at
|
This was referenced Oct 27, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix — bug fixDescription
Closes #2279.
_read_unpack, for sizes with nostructformat code, now raisesStructErroron a short read instead of silently returning a smaller integer;quietstill returns the partial value.origin/main. Passing on the rebased head.