Skip to content Skip to sidebar Skip to footer

Python Flake8 Py Reporting W391 (no Newline At End Of File) Incorrectly

W391 says that there should be one (and only one) blank line at the end of file. However, flake8 reports the error when there is at least one newline at the end of the file: $ cat

Solution 1:

Apparently vim automatically adds a newline to every file, which fools me into thinking that last blank line isn't there. Over time this implicit newline confused me into thinking two newline characters at the end created one blank line.

So, the warning is correct. There should be one and only one \n at the end of the file.

Post a Comment for "Python Flake8 Py Reporting W391 (no Newline At End Of File) Incorrectly"