Repository navigation
Test pickling of InvalidChunkLength - #5247
Merged
Merged
Conversation
illia-v
reviewed
Sep 10, 2026
illia-v
left a comment
Member
There was a problem hiding this comment.
Could we assert that non-default length, partial, and expected survive pickling and unpickling?
At the moment this only checks that pickling and unpickling succeed and preserve the exception type.
brianhelba
force-pushed
the
pickle-invalid-chunk-length
branch
from
September 12, 2026 19:41
b5f838e to
30ff558
Compare
`InvalidChunkLength` is not covered by the `TestPickle` matrix, and it is a natural candidate for it: the exception carries a whole `HTTPResponse` object in its `args`, which is exactly the kind of payload that can break pickling when an exception crosses a process boundary (e.g. multiprocessing or concurrent.futures workers). The test builds a response that has been partially read, so that `partial`, `expected`, and `length` all hold non-default values, and asserts that each of them survives a pickle round trip.
brianhelba
force-pushed
the
pickle-invalid-chunk-length
branch
from
September 12, 2026 19:45
30ff558 to
3aba839
Compare
Contributor
Author
|
@illia-v Done. |
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.
InvalidChunkLengthis not covered by theTestPicklematrix, and it is a natural candidate for it: the exception carries a wholeHTTPResponseobject in itsargs, which is exactly the kind of payload that can break pickling when an exception crosses a process boundary (e.g. multiprocessing or concurrent.futures workers).The test builds a response that has been partially read, so that
partial,expected, andlengthall hold non-default values, and asserts that each of them survives a pickle round trip.