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
extraction: a missing engine package raises two EngineWarnings #1045
Requesting an engine whose package is absent produces twoEngineWarnings for one problem. Measured on main:
Extractor(..., engine='pypcap') -> 2 EngineWarnings
- extraction engine 'PyPCAP' not available; using default engine instead
- engine PyPCAP (`pcap`) is not installed; using default engine instead
Extractor(..., engine='pcap_ct') -> 2 (same pair)
Cause:Extractor.import_test warns (pcapkit/foundation/extraction.py:740) and returns None. The caller's else branch then warns again (:691).
This contradicts the engines' own design. pypcap.py, pcap_ct.py and pyshark.py each return None from unsupported_reason for an absent package specifically so the import test reports it once, rather than "two warnings for one problem". PyShark and PyPCAPFile, when blocked by unsupported_reason instead, correctly produce one warning.
Fix: have exactly one of the two sites warn on the missing-package path, keeping the message that names the module. Add a test asserting exactly one EngineWarning for a missing engine package, and one for an engine blocked by unsupported_reason.
Activity
fix(extraction): name the module once when import_test has no display…
docs(changelog): correct the #1045 entry's scope (#1045)
fix(foundation): warn once when an extraction engine is unavailable (#…