-
Notifications
You must be signed in to change notification settings - Fork 441
Description
I'm using the latest Pyshark to read pcap files and dump their contents to stdout. Sometimes I'm able to read all the packets from a given file with no problems. But every 3rd or 4th time I run my program with the same input file I get this error:
'NoneType' object has no attribute 'add_reader'
Using traceback I consistently get this output when this exception is raised:
Traceback (most recent call last):
File "/Users/vich/src/espcap/capture/espcap_file.py", line 62, in capture
dump_packets(capture, file_date_utc)
File "/Users/vich/src/espcap/capture/espcap_file.py", line 32, in dump_packets
for packet in capture:
File "/usr/local/anaconda/lib/python2.7/site-packages/pyshark/capture/capture.py", line 173, in _packets_from_tshark_sync
self._get_packet_from_stream(tshark_process.stdout, data, psml_structure=psml_structure))
File "/usr/local/anaconda/lib/python2.7/site-packages/trollius/base_events.py", line 350, in run_until_complete
return future.result()
File "/usr/local/anaconda/lib/python2.7/site-packages/trollius/futures.py", line 286, in result
raise self._exception
AttributeError: 'NoneType' object has no attribute 'add_reader'
I get this on MacOS and Linux, although more so on Linux. 'espcap.py' is the name of my application. At any rate what could be causing this?