Terry J. Reedy <tjre...@udel.edu> added the comment:

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.

----------
nosy: +rhettinger, taleinat

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38862>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to