This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients rhettinger, taleinat, terry.reedy
Date 2019-11-24.19:22:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574623374.05.0.544172943663.issue38862@roundup.psfhosted.org>
In-reply-to
Content
Currently, iomenu.IOBinding.fixnewlines makes sure that when a non-empty non-Shell file is saved (and possibly run), it ends with at least 1 newline.  At one time, I believe, compile needed this, and it is still good practice.  (Git diffs note the absence of a final newline.)

I originally planned to incorporate possible newline addition into do_rstrip, in anticipation of calling do_rstrip on save, but I have changed my mind, at least for the present.  That code can stay where it is.  If someone explicitly runs Strip Trailing Whitespace, adding a newline would sometimes be desired, but would sometimes be unexpected and possibly a nuisance.  do_rstrip will ensure that non-Shell files end with at most 1 newline.

My revised intent is that once we strip on save, saved files should be  properly formatted for use or merging into a repository.
History
Date User Action Args
2019-11-24 19:22:54terry.reedysetrecipients: + terry.reedy, rhettinger, taleinat
2019-11-24 19:22:54terry.reedysetmessageid: <1574623374.05.0.544172943663.issue38862@roundup.psfhosted.org>
2019-11-24 19:22:54terry.reedylinkissue38862 messages
2019-11-24 19:22:53terry.reedycreate