changeset 8381:3c53e19719cd stable

inifile: strip trailing spaces consistently
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 23 Apr 2020 11:02:07 +0200
parents 201135e6548b
children fa373bf186b2
files kallithea/lib/inifile.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/inifile.py	Thu Apr 23 10:38:48 2020 +0200
+++ b/kallithea/lib/inifile.py	Thu Apr 23 11:02:07 2020 +0200
@@ -97,7 +97,7 @@
     variable2 = VAL2
     <BLANKLINE>
     first_extra = EXTRA
-    spacey =  
+    spacey =
     <BLANKLINE>
     <BLANKLINE>
     # FUNCTION RESULT
@@ -191,7 +191,7 @@
             if section_settings:
                 lines += '\n' + ''.join('%s = %s\n' % (key, value) for key, value in sorted(section_settings.items()))
 
-        return sectionname + '\n' + lines
+        return sectionname + '\n' + re.sub('[ \t]+\n', '\n', lines)
 
     # process sections until comments before next section or end
     ini_lines = re.sub(r'''^