Use allow_no_value
parameter:
import ConfigParser
c = ConfigParser.ConfigParser(allow_no_value=True)
c.read("test.ini")
According to ConfigParser.RawConfigParser
(base class of ConfigParser):
When
allow_no_value
is true (default: False), options without values are accepted; the value presented for these is None.
NOTE: available in Python 2.7+, 3.2+