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

Uncaught exception when running against standalone file #9

Closed
ericwb opened this issue Apr 26, 2018 · 1 comment
Closed

Uncaught exception when running against standalone file #9

ericwb opened this issue Apr 26, 2018 · 1 comment

Comments

@ericwb
Copy link
Member

ericwb commented Apr 26, 2018

When running Bandit on setup.py (from its own directory) there is an uncaught exception:

(band)MacBook-Pro:bandit travismcpeak$ bandit -n 5 setup.py
Traceback (most recent call last):
File "/Users/travismcpeak/Documents/projects/bandit/band/bin/bandit", line 10, in
sys.exit(main())
File "/Users/travismcpeak/Documents/projects/bandit/band/lib/python2.7/site-packages/bandit/bandit.py", line 74, in main
b_mgr.run_scope(args.files)
File "/Users/travismcpeak/Documents/projects/bandit/band/lib/python2.7/site-packages/bandit/core/manager.py", line 134, in run_scope
self.b_rs, self.b_ts
File "/Users/travismcpeak/Documents/projects/bandit/band/lib/python2.7/site-packages/bandit/core/manager.py", line 170, in _execute_ast_visitor
fname, self.logger, self.b_conf, b_ma, b_rs, b_ts, self.debug
File "/Users/travismcpeak/Documents/projects/bandit/band/lib/python2.7/site-packages/bandit/core/node_visitor.py", line 60, in init
self.namespace = b_utils.get_module_qualname_from_path(fname)
File "/Users/travismcpeak/Documents/projects/bandit/band/lib/python2.7/site-packages/bandit/core/utils.py", line 134, in get_module_qualname_from_path
' Missing path or file name' % (path))
bandit.core.utils.InvalidModulePath: Invalid python file path: "setup.py" Missing path or file name

We should catch the exception and generate some sort of meaningful warning/log output based on it.

@ericwb
Copy link
Member Author

ericwb commented Apr 26, 2018

Bad import of bug from launchpad. Closing..

@ericwb ericwb closed this as completed Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant