Repository navigation
fix(foundation): warn when PyPCAP, PCAP_CT or PyPCAPFile ignores Extractor(context=) (#2313) - #2332
Merged
Merged
Conversation
…actor(context=) (#2313) Problem: the DPKT, Scapy and PyShark engines warn that a parsing context supplied through 'context=' is ignored, but the PyPCAP, PCAP_CT and PyPCAPFile engines never read Extractor._exctx and drop it silently. Fix: each of the three engines' run() emits the same AttributeWarning, naming the engine, right after its layer/protocol threshold warning, and lists it under Warns: as DPKT and Scapy do. Test: each engine's unit test drives run() with a non-empty _exctx and pins the exact warning; the shared fixtures gain an empty _exctx, so the threshold tests' call counts also pin that no context stays silent.
Owner
Author
|
Review: GOOD TO GO at
|
Contributor
|
Coverage: 91.56% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
Ready to merge at
|
4 tasks done
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 testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix — bug fixDescription
Closes #2313, per the ruling (option 1).
PyPCAP,PCAP_CTandPyPCAPFilerun()now warnAttributeWarningwhenExtractor(context=…)is given, in the same wording DPKT, Scapy and PyShark use.Warns:section lists it._exctxand checks the exact warning. The fixtures carry_exctx: {}, so the threshold tests also show that an empty context stays silent.origin/main, 3 failed (AssertionError: 0 != 1).