diff Lib/configparser.py @ 64386:16d8a4e94dd0

fix output from RawConfigParser.write and ConfigParser.write for None values (http://bugs.python.org/issue7005) (merged r84443 from the release27-mmaint branch, with changes to reflect changes in Python 3)
author Fred Drake <fdrake@acm.org>
date Fri, 03 Sep 2010 04:22:36 +0000
parents 8ba09cdb6fc4
children b2b262c5daa8
line wrap: on
line diff
--- a/Lib/configparser.py	Thu Sep 02 19:58:35 2010 +0000
+++ b/Lib/configparser.py	Fri Sep 03 04:22:36 2010 +0000
@@ -637,7 +637,7 @@
         for key, value in section_items:
             if key == "__name__":
                 continue
-            if value is not None:
+            if (value is not None) or (self._optcre == self.OPTCRE):
                 value = delimiter + str(value).replace('\n', '\n\t')
             else:
                 value = ""