Skip to content

fix(internet): ESP read/warn messages missing the ESP: prefix #2366 established #2411

Closed

Description

@JarryShaw

Describe the bug

#2366 (fixing #2297) gave ESP.make's ProtocolError messages and unavailable()'s error path an ESP: (or {self.alias}: ) prefix, but left eight sites in pcapkit/protocols/internet/esp.py unprefixed: three literals in _read_trailer, four inline in ESP.read, and one warn() in SecurityAssociation.__init__. Before #2366 none of these carried a prefix; after it, 2 of 7 comparable error paths do and 5 don't, which is the inconsistency.

This is a follow-up to #2366's own scope rather than a defect it introduced — it never touched these eight sites.

To Reproduce

Compare ESP.make's message for a missing security association (ESP: no security association for SPI ...) against ESP.read's for the same condition (no security association for SPI 0x00004321 — no prefix).

Expected behavior

Prefix all eight sites with ESP: <lowercase description>: ..., matching the convention #2366 established elsewhere in the file. warn()'s message text is the only thing naming the protocol (it blames the caller's frame), so it needs the prefix at least as much as the exceptions do.

Additional context

Found and verified during this session's #1103 prose sweep (code-level, out of that sweep's prose-only scope). Existing tests use assertIn, so adding the prefix won't break them; add whole-message tests for the corrected text alongside the fix.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 28, 2026
  2. 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 28, 2026
  3. added this to the PyPCAPKit v1.5 milestone on Oct 28, 2026
  4. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 28, 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