[3.8] bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines (GH-17366) by miss-islington · Pull Request #17370 · python/cpython

@terryjreedy @miss-islington

…H-17366)

Extra newlines are removed at the end of non-shell files. If the file only has newlines after stripping other trailing whitespace, all are removed, as is done by patchcheck.py.
(cherry picked from commit 6bf644e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

terryjreedy