Mark Dickinson <dicki...@gmail.com> added the comment: Sorry to be nitpicky, but:
(a) the line[-2] produces "IndexError: string index out of range" on empty lines, and (b) this won't detect trailing whitespace on the last line of a file, if there's no newline at the end of the file. Actually, it might also be worth checking that there *is* a newline at the end of the file; this is actually required by the C standards. (E.g., C99 5.1.1.2p2: "A source file that is not empty shall end in a new-line character".) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8912> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com