IOError if filename doesnt exist
jayvdb opened this issue · comments
$ flake8 foo
Traceback (most recent call last):
File "/usr/bin/flake8", line 9, in <module>
load_entry_point('flake8', 'console_scripts', 'flake8')()
File "/usr/lib/python2.7/site-packages/flake8/main.py", line 33, in main
report = flake8_style.check_files()
File "/usr/lib/python2.7/site-packages/flake8/engine.py", line 181, in check_files
return self._retry_serial(self._styleguide.check_files, paths=paths)
File "/usr/lib/python2.7/site-packages/flake8/engine.py", line 172, in _retry_serial
return func(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pep8.py", line 1842, in check_files
runner(path)
File "/usr/lib/python2.7/site-packages/flake8/engine.py", line 126, in input_file
return fchecker.check_all(expected=expected, line_offset=line_offset)
File "/usr/lib/python2.7/site-packages/pep8.py", line 1574, in check_all
self.check_ast()
File "/usr/lib/python2.7/site-packages/pep8.py", line 1521, in check_ast
for lineno, offset, text, check in checker.run():
File "/usr/lib/python2.7/site-packages/flake8_tuple-0.2.9-py2.7.egg/flake8_tuple.py", line 43, in run
lines = get_lines(self.filename)
File "/usr/lib/python2.7/site-packages/flake8_tuple-0.2.9-py2.7.egg/flake8_tuple.py", line 31, in get_lines
return pep8.readlines(filename)
File "/usr/lib/python2.7/site-packages/pep8.py", line 1178, in readlines
with open(filename, 'rU') as f:
IOError: [Errno 2] No such file or directory: 'foo'
It is a fairly common problem I am finding. e.g. tk0miya/flake8-coding#2