pcapy icon indicating copy to clipboard operation
pcapy copied to clipboard

Not working on Python3.10

Open stamparm opened this issue 4 years ago • 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)

stamparm avatar Jan 20 '21 14:01 stamparm

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

stamparm avatar Jan 20 '21 15:01 stamparm

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

stamparm avatar May 19 '21 17:05 stamparm

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

segevfiner avatar Nov 03 '21 13:11 segevfiner