From: Guido van Rossum Date: Thu, 17 Oct 2002 13:34:01 +0000 (+0000) Subject: Add trailing newline when saving. X-Git-Tag: v2.3c1~3754 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26a1ac462ce07405845675222a66eba2b5bed132;p=thirdparty%2FPython%2Fcpython.git Add trailing newline when saving. --- diff --git a/Demo/cgi/cgi3.py b/Demo/cgi/cgi3.py index 9aad3a0fc458..205f63df0bab 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: