Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cglewis opened this issue Dec 14, 2018 · 0 comments
Labels

Comments

@cglewis
Copy link
Member

cglewis commented Dec 14, 2018

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
@cglewis cglewis added the bug label Dec 14, 2018
@lilchurro lilchurro self-assigned this Dec 19, 2018
lilchurro added a commit that referenced this issue Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants