diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2002-03-08 18:08:47 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2002-03-08 18:08:47 (GMT) |
commit | 00824ed733a5bd9cd94227fdfbf33b98f1ae900a (patch) | |
tree | b129464338f9a6af7ccc886b143c54b23dc92784 | |
parent | 10b3eac278b40c0d5a4346f5e992915615e0bb7d (diff) | |
download | cpython-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.py | 4 |
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): |