Skip to content

fix(toolkit): drop a rejected trial's warnings in pypcapfile's header checks (#2526) - #2577

Merged
JarryShaw merged 2 commits into
mainfrom
fix/2526-pypcapfile-trial-warnings
Nov 1, 2026
Merged

JarryShaw merged 2 commits into
mainfrom
fix/2526-pypcapfile-trial-warnings

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else
  • const — regenerates constant or registry tables, members keeping their numeric values

Description of your pull request and other information

Closes #2526. Applies #2308's rule to pypcapfile's trial parses: a trial that is rejected reports nothing through warnings.

  • _default_extension_header sets _beholding around its extension-header trial, so a raising trial's warnings are dropped as under beholder.
  • _default_accepts (the header check) also leaked: the constructor reads its header outside _parse_next_layer, so _beholding does not reach it. It now holds the trial's warnings with hold_warnings and discards them when the trial raises. Under an error filter, a header that warns answers False and nothing escapes.
  • A rejected trial still logs its ProtocolError at CRITICAL. That is BaseError's loudness, which fix(protocols): a trial parse that raises and is kept as Raw still emits SchemaWarnings #2308 does not cover.

…capfile (#2526)

- `pypcapfile._default_extension_header` sets `_beholding` around its trial
  `_parse_next_layer` call, so a header that raises is dropped with its
  warnings, as `beholder` drops a replaced layer's (#2308). A HIP header cut
  to 8 octets no longer reports `packet length < 0` twice before answering
  None; a kept header still warns from the caller's line.
- Pin the `_parse_next_layer` claim that a full-length layer outside
  `beholder` holds nothing: its warning comes before the layers it carries,
  which fails if the hold condition is replaced by `hold_warnings(True)`.
- Name `beholder` in the Note's two sentences that called it "it".
- Drop timed wording from the #2516 test docstrings.

New tests fail without their fix; touched modules pass one at a time.
…r check (#2526)

- `pypcapfile._default_accepts` holds the warnings of its trial IPv4 or TCP
  parse, and drops them when the parser raises (#2308). Setting `_beholding`
  would hold nothing there: the parser reads its own header, outside
  `_parse_next_layer`. A TCP header whose Timestamps option runs past its end
  no longer warns `packet length < 0` twice before answering False; an
  accepted header still warns from the caller's line, and under `error` a
  warning still answers False.
- State `_beholding`'s meaning to cover `_default_extension_header`, which
  sets it too.
- Name `beholder` in the `_parse_next_layer` Note sentence that called it "it".

New tests fail without their fix; touched modules pass one at a time.
@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Nov 1, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review (Sonnet) of both commits: GOOD TO GO. The rebase onto main after #2519 leaves the patch-id unchanged (7646832de8ea), and the #2526, #2516, #2308 and #1580 trial-parse modules pass on the new head.

@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 1, 2026
@JarryShaw
JarryShaw merged commit e0989d6 into main Nov 1, 2026
61 of 62 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Nov 1, 2026
@JarryShaw
JarryShaw deleted the fix/2526-pypcapfile-trial-warnings branch November 1, 2026 16:14
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 1, 2026
JarryShaw added a commit that referenced this pull request Nov 1, 2026
- Added: one's-complement checksum verification and computation (#2543),
  and the IPX and SCTP registration wrappers (#2521).
- Folded into unreleased entries: LinuxSLL/FRAD/Netlink registries (#2527),
  the IGMP class names (#2542), TLS record chaining and the SSLv2 trial's
  warnings (#2537), DTLS reassembly via Extractor and toolkit (#2528), and
  IP_Pseudo's walk at any depth (#2543). ICMP drops its stale checksum line.
- Breaking: make() checksums, DRARP's module (#2540), IPv6 overlapping
  fragments (#2569), TCP_GAP_LIMIT replacing TCP.__window__ (#2579), and
  Extractor/extract's positional dtls (#2528).
- Changed: member order (#2490), conventions (#2542, #2521, #2570), CI -n
  logical (#2572). Fixed: AppType.get (#2568), trial warnings (#2519, #2577).
- CHANGELOG.md regenerated; util/changelog_md.py --check passes.
@github-actions github-actions Bot added this to the PyPCAPKit v1.6 milestone Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(toolkit): pypcapfile's _default_extension_header still reports a raising trial's warnings

1 participant