ConfigParser Keys

N

Neil Benn

Hello,

To my chagrin, I've just discovered that SafeConfigParser, by
default, returns all the keys in the key/value pairing in lowercase
(what earthly possible reason it would do this I do not know!). Does
anyone know of a way of stopping it doing this?

Cheers,

Neil

--

Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 47
D-01307
Dresden
Germany

Tel : +49 (0)351 4173 154
e-mail : (e-mail address removed)
Cenix Website : http://www.cenix-bioscience.com
 
P

Peter Otten

Neil said:
To my chagrin, I've just discovered that SafeConfigParser, by
default, returns all the keys in the key/value pairing in lowercase
(what earthly possible reason it would do this I do not know!). Does

The config file may be edited by a non-programmer. It is a safe assumption
that he will expect KEY=value, key=value and Key=value to affect the same
option.
anyone know of a way of stopping it doing this?

Untested:

class CaseSensitiveSafeOptionParser(SafeOptionParser):
def optionxform(self, optionstr):
return optionstr

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Plone FAQ 1
UML Tools 1
__eq__ on a dict 9
Python Twain 0
How to close a process in win32 0
CGI, FieldStorage and Filename 0
Oddity is shutil.copyfileobj 0
Logging 0

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top