E999 reports invalid column
Please provide the following version information
- Version of Python which has Flake8 installed (e.g.,
python -V
)
Python 2.7.12 and Python 3.5.1
- How you installed Flake8 (e.g.,
pip
,apt
,yum
, etc.)
pip
- If you used pip, the version of pip installed (e.g.,
pip --version
)
v8.1.2
- Version of setuptools installed (e.g.,
python -c 'import setuptools; print(setuptools.__version__)'
)
28.6.0
- Version of Flake8 installed (i.e., copy and paste all of the output from
flake8 --version
)
3.0.4 (pycodestyle: 2.0.0, pyflakes: 1.2.3, mccabe: 0.5.2) CPython 2.7.12 on Windows
3.0.4 (pyflakes: 1.2.3, mccabe: 0.5.2, pycodestyle: 2.0.0) CPython 3.5.1 on Windows
Please describe the problem or feature
Flake8 incorrectly reports the location of syntax errors.
If this is a bug report, please explain with examples (and example code) what you expected to happen and what actually happened.
When running on a file with broken syntax, such as this:
foo(
Flake8 reports the syntax error as 2 past the last code character. The EOL of the file doesn't seem to matter. The above code (with 4 total characters) is reported as being on character 6 of the line.
.\broken.py:1:1: E902 TokenError: EOF in multi-line statement
.\broken.py:1:6: E999 SyntaxError: unexpected EOF while parsing
Note: Originally reported here.