diff Lib/ConfigParser.py @ 64385:16cefdfed682 2.7

fix output from RawConfigParser.write and ConfigParser.write for None values (http://bugs.python.org/issue7005)
author Fred Drake <fdrake@acm.org>
date Fri, 03 Sep 2010 03:55:50 +0000
parents 4f76ce69aed0
children aa873004cea8
line wrap: on
line diff
--- a/Lib/ConfigParser.py	Thu Sep 02 22:23:19 2010 +0000
+++ b/Lib/ConfigParser.py	Fri Sep 03 03:55:50 2010 +0000
@@ -400,7 +400,7 @@
             for (key, value) in self._sections[section].items():
                 if key == "__name__":
                     continue
-                if value is not None:
+                if (value is not None) or (self._optcre == self.OPTCRE):
                     key = " = ".join((key, str(value).replace('\n', '\n\t')))
                 fp.write("%s\n" % (key))
             fp.write("\n")