Repository navigation
fix(corekit): an untyped ListField packs the bytes it unpacks (#1489) - #1494
Merged
Merged
Conversation
Without an item_type, ListField.unpack returns the field's octets as one bytes value, but ListField.pack iterated it and rejected each int. pack now writes such a value as-is; typed ListFields are unchanged. Drop the #1489 Gap row from the field round-trip table, and add tests/corekit/test_listfield_untyped_pack_1489_unit.py.
Owner
Author
|
Verdict: GOOD TO GO at
Non-blocking:
|
2 of 13 tasks
Contributor
|
Coverage: 89.65% (unit tier, Python 3.14,
Per-file detail: the |
This was referenced Oct 9, 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.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeAdded a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
Without an
item_type,ListField.unpackreturns the field's octets as onebytes, butListField.packiterated that value and rejected eachint, sopack(unpack(b))raisedFieldValueError.ListField.packnow writes such abytesvalue as-is (pcapkit/corekit/fields/collections.py:145-146). A typedListFieldstill packs item by item, and an untyped list ofbytesitems is still joined.ListField.__init__is untouched, and a trial merge with #1493 is clean.Gap(1489, ...)row fromtests/corekit/test_field_roundtrip_unit.py.tests/corekit/test_listfield_untyped_pack_1489_unit.py: 4 of its 9 checks fail onmain'scollections.py, and all pass with the fix.make test:tests/corekit474 passed;tests/protocols/test_capture_roundtrip_runtime.py4 passed;tests/project419 passed, 1 skipped;tests/test_docstring_contract.py7 passed.repr(frame.info.to_dict())hashed per file over the 23 files inexamples/capturesis identical with and without the fix.Closes #1489