You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3807439
Browse filesBrowse the repository at this point in the historyBrowse files
fix(toolkit): lead every adapter message with its engine's own __engine_name__ (#2399)
The pcapkit.toolkit adapters put the engine name mid-sentence instead of
leading with it, unlike the <prefix>: <lowercase description>: ...
{value!r} form #2232/#2257 established, and hand-typed the name rather
than reading it off the engine class's own __engine_name__.
Each adapter module gains _ENGINE = <EngineClass>.__engine_name__ (plus
the import), so a rename in pcapkit/foundation/engines/ cannot leave the
adapter spelling the old name. Four modules, five sub-bugs:
- pcap_ct.py/pypcap.py: "IPv4 reassembly is not supported by the pcap-ct
engine: ..." -> "PCAP_CT: IPv4 reassembly is not supported: ..." (and
the PyPCAP sibling).
- pypcapfile.py: "invalid PyPCAPFile IPv4 address: 5" ->
"PyPCAPFile: invalid IPv4 address: 5" (same for MAC address); the IPv6
UnsupportedCall and the "Frame N: TCP over IPv6 ..." warning get the
same treatment.
- pyshark.py: boolean-field, frame.time_epoch and no-frame-layer messages
all reordered the same way.
- scapy.py: the import-time warning reordered; the quoted package name
is lowercased to 'scapy' to match the actual failing import and the
sibling dependency warnings elsewhere in the codebase, which quote the
installable name.
The engine classes' toolkit imports are all function-local, so the new
toolkit -> foundation.engines import introduces no cycle.
Tests: new tests/toolkit/test_engine_message_prefix_2304_unit.py (9
tests) pins each message whole and asserts each module's _ENGINE is the
engine class's own attribute. Existing pins in the four engines' test
files updated for the new text.
0 commit comments