Repository navigation
fix(foundation): Extractor.output message, make_name registry pollution, scapy engine _offmt - #1113
Merged
Merged
Conversation
…on, scapy engine _offmt - Extractor.output's UnsupportedCall now names 'output' instead of 'format'. - Extractor.make_name looks the format up with dict.get, so an unknown format is no longer inserted into the __output__ defaultdict before FormatError. - The scapy engine sets ext._offmt from the dumper's kind, as the other engines do, so Extractor.format works after a scapy extraction. Regression tests in tests/foundation/test_extraction_output_offmt_unit.py. Closes #1095
Owner
Author
|
Cross-review verdict on
Known limits, not regressions:
|
This was referenced Oct 6, 2026
Contributor
|
Coverage: 88.74% (unit tier, Python 3.14,
Per-file detail: the |
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): ranpylint,mypyandisorton the three files. The new module scores 10.00, and no findings fall on changed lines. The findings that remain are pre-existing.make testpasses, and a test case covers the change: see the modules belowWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #1095.
Extractor.outputnow namesoutputin itsUnsupportedCall. The sibling properties (format,frame,reassembly,trace) were already correct.make_namenow uses__output__.get(fmt), so an unknown format is no longer inserted into the defaultdict.read_framesetsext._offmt = ofile.kind, asdpkt.py:179does. History:74707ebc8(2023-04-27) removedext.record_header()from this engine, and that call had set_offmtas a side effect of dumping the global header. DPKT sets_offmtitself, but Scapy never did. This PR follows DPKT and does not restorerecord_header, whose future is chore(foundation): decide the fate of the unused public Extractor.record_header #1104.Probe (base
b10e7951b→ this branch): message'format'→'output'. Aftermake_name(..., 'bogus'),'bogus' in __output__wasTruewith 8→9 keys and is nowFalsewith 8→8. Scapy.formatraisedAttributeError: ... '_offmt'and now returnsjson.Tests: with the fix reverted,
tests/foundation/test_extraction_output_offmt_unit.pyreports3 failed. With the fix, it reports3 passed. The other modules:test_extraction.py22 passed,engines/test_scapy_engine.py2 passed,engines/test_runtime_engines.py5 passed, andtests/project379 passed, 1 skipped.