Bug 239681

Summary: net/py-pcap: Cannot import module with python 3
Product: Ports & Packages Reporter: Craig Leres <leres>
Component: Individual Port(s)Assignee: Muhammad Moinur Rahman <bofh>
Status: Closed FIXED    
Severity: Affects Only Me CC: w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (bofh)
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
poudriere jail build/install capture none

Description Craig Leres freebsd_committer 2019-08-06 20:14:04 UTC
Created attachment 206313 [details]
poudriere jail build/install capture

I was surprised to find that py-pcap does not work with python 3. For example in a poudriere jail running 11.2-RELEASE-p10 if I build and install py36-pcap, attempting to import it results in a stack trace ending with:

    ModuleNotFoundError: No module named '_pcap'

This seems to be related to swig and might well be an upstream problem.

I'll attach a log that shows my test.
Comment 1 Muhammad Moinur Rahman freebsd_committer 2019-08-06 21:34:24 UTC
Hi Leeres,
Yes I saw it too the other day. Maybe we should move forward to net/py-pycap. Scapy works with it. Actually supports py-pcapy too. I am just trying to find which one works better. Seems like py-pycap is well maintained. Any advices?
Comment 2 Muhammad Moinur Rahman freebsd_committer 2020-03-31 21:05:41 UTC
Author: bofh
Date: Tue Mar 31 21:00:39 2020
New Revision: 530018
URL: https://svnweb.freebsd.org/changeset/ports/530018

 net/py-pcap: Mark DEPRECATED and set EXPIRATION_DATE

 - Broken with python3 please consider using net/py-pypcap


Modified: head/net/py-pcap/Makefile
--- head/net/py-pcap/Makefile	Tue Mar 31 20:40:43 2020	(r530017)
+++ head/net/py-pcap/Makefile	Tue Mar 31 21:00:39 2020	(r530018)
@@ -12,6 +12,9 @@ COMMENT=	Python interface to LBL Packet Capture librar

+DEPRECATED=	Broken with python3 please consider using net/py-pypcap
BUILD_DEPENDS=	swig3.0:devel/swig30

USES=		python