Skip to content

fix(corekit): a failed list zero-fill leaves its ledger debit behind #2705

Closed

Description

@JarryShaw

Left over from #2701's review, after it merged before the follow-up landed. In pcapkit.corekit.fields.field, _zero_fill_items debits the zero-pad ledger up front (ledger[0] -= padding) and never restores it if an item fails after the fill.

Measured on a synthetic schema whose item raises after the fill: one failure took ledger[0] from 1000 to -997, and every later legitimate cut in that context was refused. The ledger is context-wide.

Fix: restore the debit on failure (try/finally), and add a test that a failed fill leaves the ledger as it was. Also trim the four-line # NOTE: in HTTPv2._make_data to the two-line limit.

Activity

  1. added this to the PyPCAPKit v1.6 milestone on Nov 2, 2026
  2. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 2026
  3. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The fix is ready at 8ab90dfdb. Its PR is held because the Actions queue is at 50; new PRs wait for fewer than 20. A Sonnet review is running on the local commit in the meantime.

  4. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    The PR is #2706.

  5. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions