ConfigParser Keys

Discussion in 'Python' started by Neil Benn, Jun 21, 2004.

  1. Neil Benn

    Neil Benn Guest

    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 :
    Cenix Website : http://www.cenix-bioscience.com
    Neil Benn, Jun 21, 2004
    #1
    1. Advertising

  2. Neil Benn

    Peter Otten Guest

    Neil Benn wrote:

    > 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
    Peter Otten, Jun 21, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sandeep Kanwal

    serial keys/validation keys

    sandeep Kanwal, Oct 29, 2004, in forum: C++
    Replies:
    1
    Views:
    578
    Mike Wahler
    Oct 29, 2004
  2. Harry George
    Replies:
    9
    Views:
    690
    sonal
    Jun 13, 2006
  3. Replies:
    10
    Views:
    710
    Daniel T.
    Feb 3, 2006
  4. alan
    Replies:
    3
    Views:
    350
    Victor Bazarov
    Nov 28, 2007
  5. Replies:
    3
    Views:
    418
Loading...

Share This Page