Skip to content

test(one-home): dpkt's new _fragment helper's IP version checks are flagged as copies of IPV6_NEXT_HEADER_OFFSET #2342

Closed

Description

@JarryShaw

tests/project/test_rfc_constants_one_home_1739_unit.py::TestNotReinlined::test_sweep fails on PR #2338's head (42903c784): the new pcapkit/toolkit/dpkt.py::_fragment helper takes an IP version number, and the sweep flags every 6 it spells as a copy of the homed constant IPV6_NEXT_HEADER_OFFSET (value 6, home pcapkit.protocols.internet.ipv6). A false positive by value collision with the unrelated IP version number 6.

Three sites, two distinct _context() strings:

pcapkit/toolkit/dpkt.py:708: _fragment(6) (a copy of a homed constant?)
pcapkit/toolkit/dpkt.py:569: version == 6 (a copy of a homed constant?)
pcapkit/toolkit/dpkt.py:561: version == 6 (a copy of a homed constant?)

The precedent is already in the test file's NOT_A_COPY dict for the sibling engine module:

('pcapkit/foundation/engines/dpkt.py', 'version == 6'):
    'the IP version number',

and the same reading for pcapkit/protocols/misc/pcap/frame.py and pcapkit/protocols/misc/pcapng.py, both ('…', 'version == 6'): 'the IP version number, not the decimal places of a resolution'. So pcapkit/toolkit/dpkt.py needs the equivalent two entries.

Failing job: Unit Tests / Python 3.15 (run 40417535198).

The fix cannot land on main ahead of #2338. test_sweep also guards against stale entries (assertEqual(sorted(set(NOT_A_COPY) - seen_copy), [])), so entries naming _fragment fail on a tree where _fragment does not exist yet. Measured on 9dd46d8d4: with the entries added and #2338's dpkt.py reverted, test_sweep fails with [('pcapkit/toolkit/dpkt.py', '_fragment(6)'), ('pcapkit/toolkit/dpkt.py', 'version == 6')] != []. The entries therefore have to go in #2338 itself, or merge simultaneously with it.

Activity

  1. added this to the PyPCAPKit v1.5 milestone on Oct 27, 2026
  2. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    testPull requests that add or correct tests (test: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 27, 2026
  3. JarryShaw commented on Oct 27, 2026

    @JarryShaw
    OwnerAuthor

    Folded into PR #2338 (amended to d2841387c), since the NOT_A_COPY entries only match once that PR's dpkt.py is in the tree, as you noted. Closing with it.

  4. removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 27, 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)testPull requests that add or correct tests (test: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions