PyPCAPKit icon indicating copy to clipboard operation
PyPCAPKit copied to clipboard

Iterable error whenever we attempt to extract the PCAP file, no matter which file is used.

Open tybruno opened this issue 8 months ago • 0 comments

Hello, it seems like no matter what PCAP file I use, I always get the same error. I even use the example PCAP files that you have, but I still get this error.


from pcapkit import extract
from pathlib import Path


def main() -> None:
    pcap_path = Path("in.pcap")
    if not pcap_path.exists():
        print(f"File not found: {pcap_path}")
        return
    try:
        extraction = extract(fin=str(pcap_path), nofile=True)
        packets = list(extraction)
        print(f"Extracted {len(packets)} packets from {pcap_path}")
        for i, pkt in enumerate(packets[:5]):
            print(f"Packet {i+1}: {pkt}")
    except Exception as exc:
        print(f"PyPCAPKit error: {exc}")

if __name__ == "__main__":
    main()

[WARNING] 06/23/2025 02:11:10 PM - EOF reached
WARNING:pcapkit:EOF reached
[CRITICAL] 06/23/2025 02:11:10 PM - IterableError: 'Extractor(auto=True)' object is not iterable
CRITICAL:pcapkit:IterableError: 'Extractor(auto=True)' object is not iterable

pypcapkit==1.3.5.post21 Python 3.10.16 Apple M4 Pro sequoia 15.5 (24F74)

tybruno avatar Jun 24 '25 16:06 tybruno