faucetsdn/NetworkML

AttributeError: 'PosixPath' object has no attribute 'rfind' when not supplying a PCAP file

cglewis opened this issue · 0 comments

Description

PoseidonML crashes if the PCAP environment variable is not set to a PCAP file, for example if it's set to a directory instead.

Environment

latest from master, on OSX

Steps to reproduce

  • $ export PCAP=~/tmp/pcaps
  • make

Expected result

It should either work, or inform the user that it's being set incorrectly in a graceful way.

Actual result

Running OneLayer Eval on PCAP file /tmp/pcaps
Traceback (most recent call last):
  File "eval_OneLayer.py", line 204, in <module>
    instance.main()
  File "eval_OneLayer.py", line 46, in main
    os.path.split(child)[-1].split('.')[-1] in { 'pcap','dump','cap'}:
  File "/usr/lib/python3.5/posixpath.py", line 103, in split
    i = p.rfind(sep) + 1
AttributeError: 'PosixPath' object has no attribute 'rfind'
make: *** [eval_onelayer_nobuild] Error 1