RE: why does Configparser change names to lowercase ?

Discussion in 'Python' started by Guest, Sep 18, 2007.

  1. Guest

    Guest Guest

    This works ...

    Cf=ConfigParser.ConfigParser()
    Cf.optionxform=str
    ....

    Blinston.
    -----Original Message-----
    From: python-list-bounces+blinston_fernandes= [mailto:python-list-bounces+blinston_fernandes=] On Behalf Of Joshua J. Kugler
    Sent: Tuesday, September 18, 2007 3:44 AM
    To:
    Subject: Re: why does Configparser change names to lowercase ?

    On Friday 14 September 2007 12:21, stef mientki wrote:
    > Why does Configparser change names to lowercase ?
    >
    > As Python is case sensitive (which btw I don't like at all ;-) but now
    > when really need the casesensitivity, because it handles about names
    > which should be recognized by human, it changes everything to
    > lowercase ????
    >
    > thanks,
    > Stef Mientki


    According to the ConfigParser docs:

    "All option names used in interpolation will be passed through the
    optionxform() method just like any other option name reference. For example, using the default implementation of optionxform() (which converts option names to lower case), the values "foo %(bar)s" and "foo %(BAR)s" are equivalent."

    So, it seems it would be trivial so sublcass ConfigParser, and reimplement
    optionxform()

    Hope that helps.

    j

    --
    Joshua Kugler
    Lead System Admin -- Senior Programmer
    http://www.eeinternet.com
    PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE

    --
    http://mail.python.org/mailman/listinfo/python-list
    Guest, Sep 18, 2007
    #1
    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. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,761
    Smokey Grindel
    Dec 2, 2006
  2. Glen
    Replies:
    2
    Views:
    244
  3. stef mientki
    Replies:
    2
    Views:
    423
    Rob Wolfe
    Sep 14, 2007
  4. Replies:
    3
    Views:
    416
  5. dieter
    Replies:
    0
    Views:
    98
    dieter
    Feb 2, 2013
Loading...

Share This Page