E999 triple-quoted string literal reports invalid position
Please describe how you installed Flake8
$ pip install flake8
Please provide the exact, unmodified output of flake8 --bug-report
{
"dependencies": [
{
"dependency": "setuptools",
"version": "28.6.0"
}
],
"platform": {
"python_implementation": "CPython",
"python_version": "2.7.12",
"system": "Windows"
},
"plugins": [
{
"plugin": "mccabe",
"version": "0.5.2"
},
{
"plugin": "pycodestyle",
"version": "2.2.0"
},
{
"plugin": "pyflakes",
"version": "1.3.0"
}
],
"version": "3.2.0"
}
Please describe the problem or feature
E999 SyntaxError: EOF while scanning triple-quoted string literal
errors are being reported at the wrong position.
If this is a bug report, please explain with examples (and example code) what you expected to happen and what actually happened.
When running flake8
on this code:
def test():
"""
#
I get the following results:
.\e901.py:1:1: E902 TokenError: EOF in multi-line string
.\e901.py:3:13: E999 SyntaxError: EOF while scanning triple-quoted string literal
Note the E999
result reported at position 3:13
, which is 7 characters past the end of the line. As far as I can tell this specific error is always being reported 7 characters past the end of the line. Whether the file is LF
or CRLF
makes no difference in the reported position.
Note: Originally filed over here