473,320 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ConfigParser lower-cases options automatically?

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.

Jul 18 '05 #1
1 2201
Matthew Wilson <mw*****@sarcastic-horse.com> pisze:
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.


Yes, I think it was intentional. Check optionxform() in Python
documentation to get an idea how to make ConfigParser case sensitive.

--
Jarek Zgoda
Unregistered Linux User #-1
http://www.zgoda.biz/ JID:zg***@chrome.pl http://zgoda.jogger.pl/
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg Krohn | last post by:
I'm trying to subclass ConfigParser so I can use a custom __read method (the custom format doesn't conform to RFC 822) when needed. Needless to say, it's not working as expected. In the...
2
by: Roy H. Berger | last post by:
If I want to subclass ConfigParser and changed the optionxform method to not return things in lower case wouldn't I just need the following code in my subclasss module? from ConfigParser import...
11
by: Manlio Perillo | last post by:
Regards. Since sections in CongiParser files are delimited by , why there is not an escape (and unescape) function for escaping &, characters to &amp;, &lbrack; and &rbrack; ? Thanks ...
2
by: rzed | last post by:
I am working with PythonCard in one of my apps. For its purposes, it uses an .ini file that is passed to ConfigParser. For my app, I also need configuration information, but for various reasons,...
10
by: Terry Carroll | last post by:
It looks like ConfigParser will accept a list to be writing to the *.ini file; but when reading it back in, it treats it as a string. Example: ############################### import...
1
by: pipehappy | last post by:
Hello everyone: I came across the module ConfigParser and can use it correctly. import ConfigParser fp = open('test.cfg','w+') config = ConfigParser.ConfigParser() config.readfp(fp)...
4
by: Danil Dotsenko | last post by:
Wrote a little "user-friedly" wrapper for ConfigParser for a KDE's SuperKaramba widget. (http://www.kde-look.org/content/show.php?content=32185) I was using 2.4.x python docs as reference and...
3
by: tony.ha | last post by:
Hello I use ConfigParser as show below to read a config.txt file; from ConfigParser import ConfigParser config = ConfigParser() config.read('config.txt') items = config.items('FV') for item...
4
by: Phoe6 | last post by:
Hi, I have a configfile, in fact, I am providing a configfile in the format: Name: Foo Author: Bar Testcases: tct123
3
by: Phoe6 | last post by:
Hi, Am starting a new thread as I fear the old thread which more than a week old can go unnoticed. Sorry for the multiple mails. I took the approach of Subclassing ConfigParser to support...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.