ConfigParser.ConfigParser()
is documented to behave this way, in the Mapping Protocol Access section:
By default, all keys in sections are accessible in a case-insensitive manner. E.g.
for option in parser["section"]
yields onlyoptionxform
’ed option key names. This means lowercased keys by default.
That’s because this module parses Windows INI files which are expected to be parsed case-insensitively.
You can disable this behaviour by replacing the ConfigParser.optionxform()
function:
self.config = ConfigParser.ConfigParser()
self.config.optionxform = str
str
passes through the options unchanged.