From c790c975d78a3d7519247c119eda791121195ff0 Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Fri, 15 Mar 2002 10:24:14 +0000 Subject: [PATCH] I presume this should go here. backport akuchling's checkin of revision 1.39 of ConfigParser.py [Bug #523301] ConfigParser.write() produces broken output for values that were originally rfc822-like line continuations. Modified version of a patch from Matthias Ralfs. --- Lib/ConfigParser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/ConfigParser.py b/Lib/ConfigParser.py index 190b6942f35b..bdce25ef0d35 100644 --- a/Lib/ConfigParser.py +++ b/Lib/ConfigParser.py @@ -344,7 +344,7 @@ class ConfigParser: if self.__defaults: fp.write("[DEFAULT]\n") for (key, value) in self.__defaults.items(): - fp.write("%s = %s\n" % (key, value)) + fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) fp.write("\n") for section in self.sections(): fp.write("[" + section + "]\n") @@ -352,7 +352,7 @@ class ConfigParser: for (key, value) in sectdict.items(): if key == "__name__": continue - fp.write("%s = %s\n" % (key, value)) + fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) fp.write("\n") def remove_option(self, section, option): -- 2.47.3