ConfigParser lower-cases options automatically?

Matthew Wilson mwilson at sarcastic-horse.com
Sun Nov 23 13:42:49 EST 2003


I'm using ConfigParser to store and retreive some data across multiple
runs of my program and it looks like it automatically lower-cases my
options:

---this is the program:

import ConfigParser
cp = ConfigParser.ConfigParser()
cp.add_section('info')
cp.set('info', 'Previous-IP', '0.0.0.0')
out = open('out.txt', 'w')
cp.write(out)
out.close()
out = open('out.txt')
print out.read()

---here is the data:

[info]
previous-ip = 0.0.0.0

---end


I wonder if this is something intentionally built-in to ConfigParser in
order to remove case-sensitivity issues that are variable across
platforms.  Does anyone else have any comments or ideas?  I don't need
case-sensitivity in my script, but I am puzzled by this behavior.







More information about the Python-list mailing list