Repository navigation
refactor(protocols): keep a handled next-layer refusal quiet - #2597
Merged
Merged
Conversation
- beholder runs the decorated call inside CaughtByCaller(ProtocolError), so every ProtocolError built during it is quiet and a refusal kept as Raw logs nothing and installs neither excepthook; beholder skips its WARNING for that class. Other classes, and the outermost recovery, stay loud. - Record the rule on protocol-family-grouping.rst and the exceptions page; update beholder's docstring, IPv6's walk comment and the pcapng generator's logging notes. - tests: new protocol and beholder cases, nested recovery included; the IPv6 #2477 tests count parses and pin the error text instead of loud records.
Owner
Author
|
GOOD TO GO at |
Contributor
|
Coverage: 94.03% (unit tier, Python 3.15,
Per-file detail: the |
5 tasks done
JarryShaw
added a commit
that referenced
this pull request
Nov 2, 2026
…1.6.0 (#2449) - Added: DCCP, its checksum over the IP pseudo-header, register_dccp and register_dccp_option, and the pcapkit.const.dccp registries (#2593). - Folded into unreleased entries: LinuxSLL's stop on its ARPHRD path (#2587) and ARPHRD's __proto_dest__ (#2598), SSLv2 records chained in a segment (#2585), the checksum's move to pcapkit.corekit.checksum.internet (#2586), and IGMPv2's and IGMPv3's versioned name (#2590). - Breaking: InARP moves to pcapkit.protocols.link.inarp with no re-export, joining the DRARP entry (#2596). - Changed: the conventions' new rulings (#2599), the milestone workflow's next-open-milestone lookup (#2591), the PyPy protocols shards (#2604). Fixed: a handled next-layer refusal is quiet under beholder (#2597); the IPX crawlers restore sys.path (#2601). - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
refactor— changes neither behaviour nor performanceDescription of your pull request and other information
This implements the owner's option 2 on #2588, with sub-question 1: when the next-layer fallback refuses a layer and keeps it as
Raw, the refusal is now quiet.beholderruns the next-layer call insideCaughtByCaller(ProtocolError). AProtocolErrorit absorbs logs nothing, skips the old WARNING, and installs neithersys.excepthooknorthreading.excepthook. The error is still recorded on theRawlayer'sinfo.error.CaughtByCaller()keeps its own error loud, and so does every otherBaseErrorthe fallback absorbs, such asFieldValueError. Building a layer directly still raises loudly, and so does the outermost recovery error.Measured: across 50,164 inputs,
mainand this branch produce identical chains,info,info.error, rebuilt octets, warnings and raises. CRITICAL records drop from 44,146 to 1,150. The new tests fail onmain. Two IPv6 tests now pin the error text and a single parse instead of log records; a mutation check confirms they still catch a double parse.Left loud, as follow-ups:
ProtocolBase.analyzeandTransport.analyzesubstituteRawwithout recording the error, andpypcapfile's trial parses record nothing. Quieting them first needs the error recorded.Closes #2588