Python configparser will not accept keys without values
The ConfigParser constructor has a keyword argument allow_no_value
with a default value of False
.
Try setting that to true, and I'm betting it'll work for you.
class RawConfigParser:
def __init__(self, defaults=None, dict_type=_default_dict,
allow_no_value=False):
self._dict = dict_type
self._sections = self._dict()
self._defaults = self._dict()
if allow_no_value:
self._optcre = self.OPTCRE_NV
else:
self._optcre = self.OPTCRE
if defaults:
for key, value in defaults.items():
self._defaults[self.optionxform(key)] = value
import ConfigParser
cf = ConfigParser.ConfigParser(allow_no_value=True)