habe eben das gleiche Problem gehabt wie in http://www.python-forum.de/viewtopic.ph ... ems#p72585 beschrieben: (von 2007)
Es geht darum, dass der configparser per default die Optionen case insensitiv ausgibt und im Beitrag ist auch ein workaround drin,
der mit meinem python3.1 leider nicht funktioniert.
Allerdings sehe ich in der Doku: http://docs.python.org/release/3.1/libr ... arser.html die Option
RawConfigParser.optionxform(option) beschrieben:
"RawConfigParser.optionxform(option)¶
Transforms the option name option as found in an input file or as passed in by client code to the form that should be used in the internal structures. The default implementation returns a lower-case version of option; subclasses may override this or client code can set an attribute of this name on instances to affect this behavior. Setting this to str(), for example, would make option names case sensitive."
Und so funktioniert das dann auch:
Code: Alles auswählen
import configparser
config = configparser.RawConfigParser()
config.optionxform = str
config.read(config_file)
(..)
Viele Gruesse,
Torres