helpsystems/pcapy

Not working on Python3.10

stamparm opened this issue · 3 comments

Because of ignored problems with DeprecationWarning for PY_SSIZE_T_CLEAN (#67, #68), Pcapy doesn't work anymore on Python3.10 (Note: read https://docs.python.org/3.10/whatsnew/3.10.html#id2)

Minimalistic example which fails:

import pcapy

def recv(header, packet):
    sec, usec = header.getts()
    print(sec)

cap = pcapy.open_live("any", 65535, True, 100)
cap.loop(-1, recv)

1

https://pypi.org/project/pcapy-ng/ (tl;dr: just do the pip install pcapy-ng)

You can also try https://github.com/segevfiner/cypcap which is a different project I wrote out of frustration with existing ones, and boredom 😛