Skip to content

fix(corekit): ListField, PayloadField and SchemaField have no default name #1491

Closed

Description

@JarryShaw

Describe the bug
A ListField that has not been given a name has no name at all, yet OptionField.unpack reads self.name.

Reproduction

from pcapkit.corekit.fields.collections import ListField
ListField().name   # AttributeError: 'ListField' object has no attribute '_name'

Expected behavior
A default name, as the other fields have, or an in-library error that says the field is unnamed.

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

Additional context
ListField.__init__ (pcapkit/corekit/fields/collections.py:95-106) sets no _name.

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. moved this to Pending in PyPCAPKiton Oct 9, 2026
  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 9, 2026
  4. JarryShaw commented on Oct 9, 2026

    @JarryShaw
    OwnerAuthor

    Widening scope. The #1493 worker found the same gap in two more fields, and I measured it on 00d232890:

    Field Field().name
    PayloadField (pcapkit/corekit/fields/misc.py:223) AttributeError: ... no attribute '_name'
    SchemaField (misc.py:621) AttributeError: ... no attribute '_name'
    SwitchField, ForwardMatchField fine; they delegate to the wrapped field

    Each of the four has its default name commented out (misc.py:310, :459, :655, :828). #1493 will add the default to PayloadField and SchemaField too, using the same FieldBase idiom (field.py:348-349).

  5. changed the title [-]fix(corekit): ListField().name raises AttributeError[/-] [+]fix(corekit): ListField, PayloadField and SchemaField have no default name[/+] on Oct 9, 2026
  6. 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