By specifying a default of None, a config value will have no default. We
could just leave out the value alltogether, but this way even values
without a default are "documented" (this will be extended later).
if not parser.has_section(section):
parser.add_section(section)
for option, value in options.items():
- parser.set(section, option, value)
+ # Interpret None as "no default", since ConfigParser doesn't
+ # like non-string values.
+ if not value is None:
+ parser.set(section, option, value)