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
fix(pcapng): option-guard messages end in a full stop and give the block type as a number #2301
Describe the bug
The PCAP-NG option guards (_make_option_* and _read_option_*, the "must be only one" and "must be in X Block" checks) end in a full stop, which no other <prefix>: … message does (#2232, #2257). The placement guard is worse than a style slip: it formats self._type, an IntEnum, with {}, so the message gives the block type as a bare number.
Reproduction (main9d504ead5)
>>> p._type = BlockType.Enhanced_Packet_Block; p._make_option_if_name(OptionType.if_name, name='eth0')
ProtocolError: PCAP-NG: [if_name] option must be in Interface Description Block, but found in 6 block.
>>> p._type = BlockType.Interface_Description_Block; p._opt[OptionType.if_name] = 1; p._make_option_if_name(...)
ProtocolError: PCAP-NG: [if_name] option must be only one, but 2 found.
Expected behavior PCAP-NG: [if_name] option must be in Interface Description Block, not Enhanced_Packet_Block and PCAP-NG: [if_name] option must be only one, not 2. Use .name for the block. Pins to update: test_pcapng_roundtrip_unit matches option must be only one, but 2 found, and test_pcapng_unit checks [<option>] option must be only one with assertIn.
System information
Linux, CPython 3.14.9, checkout main9d504ead5.
Blocked until the #2273 and #2278 fix PRs merge. Those fixes edit the PCAP-NG makers in pcapng.py, and this one edits the same file, so it starts from the merged tree.
Activity
JarryShaw commentedon Oct 26, 2026
Blocked until the #2273 and #2278 fix PRs merge. Those fixes edit the PCAP-NG makers in
pcapng.py, and this one edits the same file, so it starts from the merged tree.JarryShaw commentedon Oct 27, 2026
Unblocking — #2273 and #2278 merged. Open to pick up now.
fix(pcap,pcapng): prefix capture-guard messages and name the block ty…