mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
fix output from RawConfigParser.write and ConfigParser.write for None
values (http://bugs.python.org/issue7005)
This commit is contained in:
parent
5cd2d8c7ec
commit
a1e627d61c
3 changed files with 32 additions and 1 deletions
|
@ -400,7 +400,7 @@ class RawConfigParser:
|
|||
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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue