summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2002-03-08 18:08:47 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2002-03-08 18:08:47 (GMT)
commit00824ed733a5bd9cd94227fdfbf33b98f1ae900a (patch)
treeb129464338f9a6af7ccc886b143c54b23dc92784
parent10b3eac278b40c0d5a4346f5e992915615e0bb7d (diff)
downloadcpython-00824ed733a5bd9cd94227fdfbf33b98f1ae900a.zip
cpython-00824ed733a5bd9cd94227fdfbf33b98f1ae900a.tar.gz
cpython-00824ed733a5bd9cd94227fdfbf33b98f1ae900a.tar.bz2
[Bug #523301] ConfigParser.write() produces broken output for values that
were originally rfc822-like line continuations. Modified version of a patch from Matthias Ralfs.
-rw-r--r--Lib/ConfigParser.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ConfigParser.py b/Lib/ConfigParser.py
index 190b694..bdce25e 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):