Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 26a1ac4

Browse files
committed
Add trailing newline when saving.
1 parent 48123b2 commit 26a1ac4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Demo/cgi/cgi3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def store(self):
111111
try:
112112
f = open(self.mkfile(), "w")
113113
f.write(data)
114+
if data and not data.endswith('\n'):
115+
f.write('\n')
114116
f.close()
115117
return ""
116118
except IOError, err:

0 commit comments

Comments
 (0)