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)
This commit is contained in:
Fred Drake 2010-09-03 04:22:36 +00:00
parent af1e140334
commit 8844441ae6
3 changed files with 33 additions and 1 deletions

View file

@ -637,7 +637,7 @@ class RawConfigParser:
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 = ""