summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-10-17 13:34:01 (GMT)
committerGuido van Rossum <guido@python.org>2002-10-17 13:34:01 (GMT)
commit26a1ac462ce07405845675222a66eba2b5bed132 (patch)
tree9e691773aa79b42e7181df7cf144ac3005c4046e /Demo
parent48123b266cd8d041ca6d66f148c3a6c054b2cc00 (diff)
downloadcpython-26a1ac462ce07405845675222a66eba2b5bed132.zip
cpython-26a1ac462ce07405845675222a66eba2b5bed132.tar.gz
cpython-26a1ac462ce07405845675222a66eba2b5bed132.tar.bz2
Add trailing newline when saving.
Diffstat (limited to 'Demo')
-rwxr-xr-xDemo/cgi/cgi3.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Demo/cgi/cgi3.py b/Demo/cgi/cgi3.py
index 9aad3a0..205f63d 100755
--- a/Demo/cgi/cgi3.py
+++ b/Demo/cgi/cgi3.py
@@ -111,6 +111,8 @@ class WikiPage:
try:
f = open(self.mkfile(), "w")
f.write(data)
+ if data and not data.endswith('\n'):
+ f.write('\n')
f.close()
return ""
except IOError, err: