summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-10-17 13:34:01 +0000
committerGuido van Rossum <guido@python.org>2002-10-17 13:34:01 +0000
commit9cb2ce9070f134f61224a6709d1d5a5fa01e9b58 (patch)
treeea03ee5a875d27615ab43a87fd387ea26b64e79f
parentcf5b0537a5f962cb90466623d0c84d574999b1e9 (diff)
downloadcpython-9cb2ce9070f134f61224a6709d1d5a5fa01e9b58.tar.gz
Add trailing newline when saving.
-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 9aad3a0fc4..205f63df0b 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: