]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add trailing newline when saving.
authorGuido van Rossum <guido@python.org>
Thu, 17 Oct 2002 13:34:01 +0000 (13:34 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 17 Oct 2002 13:34:01 +0000 (13:34 +0000)
Demo/cgi/cgi3.py

index 9aad3a0fc4586db101f3f60cb15e955b020a1db4..205f63df0babb20c961d014463a3dfb4de30e1b2 100755 (executable)
@@ -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: