Flake8 version 3 chokes on reported errors in empty files
With version 3.0.0b2 installed it chokes on empty files when there is an error reported for the file and hangs up:
$ touch empty.py
$ flake8 empty.py
Process Process-1:
Traceback (most recent call last):
File "/home/xzise/.pyenv/versions/3.5.1/lib/python3.5/multiprocessing/process.py", line 254, in _bootstrap
self.run()
File "/home/xzise/.pyenv/versions/3.5.1/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/xzise/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 222, in _run_checks_from_queue
checker.run_checks(self.results_queue, self.statistics_queue)
File "/home/xzise/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 556, in run_checks
self.run_ast_checks()
File "/home/xzise/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 473, in run_ast_checks
text=text,
File "/home/xzise/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 433, in report
physical_line = self.processor.line_for(line_number)
File "/home/xzise/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/processor.py", line 253, in line_for
return self.lines[line_number - 1]
IndexError: list index out of range
^C... stopped while processing files
The version of flake8 installed: 3.0.0b2 (flake8-string-format: 0.3.0.dev0, flake8_quotes: 0.3.0, mccabe: 0.5.0, pyflakes: 1.2.3, pycodestyle: 2.0.0, flake8-future-import: 0.4.3) CPython 3.5.1 on Linux
In this case flake8-future-import
complains that a __future__
import is missing in line 1
.