Skip to content

fix(corekit): a ListField without item_type cannot pack what it unpacks #1489

Closed

Description

@JarryShaw

Describe the bug
unpack returns bytes, and pack then rejects those bytes.

Reproduction

from pcapkit.corekit.fields.collections import ListField
f = ListField(length=4); f.name = 'items'; f = f({})
f.pack(f.unpack(b'abcd', {}), {})   # FieldValueError: Field items has invalid value.

Expected behavior
b'abcd'.

System information
Linux, CPython 3.14.7, main at 00d232890.

Additional context
unpack returns file.read(length) (pcapkit/corekit/fields/collections.py:179), and pack iterates that as items, so it rejects each int (:146, :154). Schema.pack writes bytes values itself (pcapkit/protocols/schema/schema.py:846), so only direct use of the field is affected.

Found by the #1202 corekit round-trip slice.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 9, 2026
  2. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1492 merges. #1492 adds the Gap row for this defect to tests/corekit/_roundtrip.py, and the fix must delete that row in the same PR.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 9, 2026
  4. moved this from Pending to Blocked in PyPCAPKiton Oct 9, 2026
  5. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1492 merged (d9e12e82e). A worker is starting on this against current main; the fix PR deletes this defect's Gap row.

  6. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 9, 2026
  7. moved this from Blocked to WIP in PyPCAPKiton Oct 9, 2026
  8. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions