Python subprocess.Popen scapy -


i'm running scapy pcap analyzer p = subprocess.popen(run_cmd, shell==true, stdin=subprocess.pipe, stdout=subprocess.pipe)

the script runs correctly, unless there error pcap file. if pcap file doesn't work whatever reason, following:

raise scapy_exception("not pcap capture file (bad magic)")

anyone know of way handle these errors? goal write error file can reference later. dumping ton of pcaps @ once, if don't work, don't want errors being printed screen. outputted file if occur. assume has stdout, how can catch these errors?

i have tried if "proc.returncode != 0": print "error" , same "proc.poll() != 0". no luck either of those.

thanks insight community may have.


Popular posts from this blog