Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77036 > unrolled thread
| Started by | doit4um@gmail.com |
|---|---|
| First post | 2014-08-26 03:44 -0700 |
| Last post | 2014-08-26 21:24 -0700 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.python
help! about pypcap.dispatch doit4um@gmail.com - 2014-08-26 03:44 -0700
Re: help! about pypcap.dispatch Chris Angelico <rosuav@gmail.com> - 2014-08-27 00:45 +1000
Re: help! about pypcap.dispatch Simmen <doit4um@gmail.com> - 2014-08-26 20:03 -0700
Re: help! about pypcap.dispatch Simmen <doit4um@gmail.com> - 2014-08-26 21:24 -0700
| From | doit4um@gmail.com |
|---|---|
| Date | 2014-08-26 03:44 -0700 |
| Subject | help! about pypcap.dispatch |
| Message-ID | <89a67381-4e4f-4ae0-83e3-59ca48bdf619@googlegroups.com> |
Hi,
I'm using Python 2.7.6 in Centos 6.5.
I have defined
"p = pcap.pcap(timeout_ms=1000)
def function(timestamp,pkt,*args):
"
and try to run "p.dispatch(-1,function)"
and I got this:
p.dispatch(-1,function)
File "pcap.pyx", line 296, in pcap.pcap.dispatch (pcap.c:3182)
TypeError: raise: exception class must be a subclass of BaseException
why this happened? Anybody know how to solve it?
thanks!
[toc] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-08-27 00:45 +1000 |
| Message-ID | <mailman.13458.1409064325.18130.python-list@python.org> |
| In reply to | #77036 |
On Tue, Aug 26, 2014 at 8:44 PM, <doit4um@gmail.com> wrote: > Hi, > > I'm using Python 2.7.6 in Centos 6.5. > > I have defined > "p = pcap.pcap(timeout_ms=1000) > def function(timestamp,pkt,*args): > " > and try to run "p.dispatch(-1,function)" > > and I got this: > p.dispatch(-1,function) > File "pcap.pyx", line 296, in pcap.pcap.dispatch (pcap.c:3182) > TypeError: raise: exception class must be a subclass of BaseException > > why this happened? Anybody know how to solve it? Where did pcap.pyx come from? What version is it? Is it something that was written for an ancient version of Python? It might be raising a string exception. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Simmen <doit4um@gmail.com> |
|---|---|
| Date | 2014-08-26 20:03 -0700 |
| Message-ID | <bd8370a1-a191-4ce8-b560-4a55d4a35b07@googlegroups.com> |
| In reply to | #77045 |
在 2014年8月26日星期二UTC+8下午10时45分15秒,Chris Angelico写道: > Where did pcap.pyx come from? What version is it? Is it something that > > was written for an ancient version of Python? It might be raising a > > string exception. > > > > ChrisA thank you for your reply! sorry for the terrible question, I install both libpcap 1.4.0 and pypcap 1.1.1, and it seems the pypcap does not support python2.7. Is there any pcap packet support python 2.7, or I must capture packet with socket?
[toc] | [prev] | [next] | [standalone]
| From | Simmen <doit4um@gmail.com> |
|---|---|
| Date | 2014-08-26 21:24 -0700 |
| Message-ID | <5135282d-35de-4cb0-92ac-2c1ace794d49@googlegroups.com> |
| In reply to | #77045 |
在 2014年8月26日星期二UTC+8下午10时45分15秒,Chris Angelico写道: > Where did pcap.pyx come from? What version is it? Is it something that > > was written for an ancient version of Python? It might be raising a > > string exception. > > > > ChrisA thank you for your reply! sorry for the terrible question, I install both libpcap 1.4.0 and pypcap 1.1.1, and it seems the pypcap does not support python2.7. I'll try scapy instead. thank you again!
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web