Posts: 4,647
Threads: 1,494
Joined: Sep 2016
is there a way to customize
configparser to disable case insensitive aspect of INI files. i only need
case transparency where sections and options i add retain the same case i added them with so that the re-created file has them. it turns out that writing the INI back out to a file changes all sections and all options to lower case even if i change nothing.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
can you be more explicit in pointing to the docs? i don't see it. or maybe the PDF doc page number.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
Oct-02-2020, 01:16 AM
(This post was last modified: Oct-02-2020, 01:16 AM by Skaperen.)
i think this was over explained. it simply is:
the attribute of the configparser object named "optionxform" is where the configparser code gets a reference to the function it calls to change option names and section names to lower case. by replacing this reference, you can substitute your own function to make whatever change you want to have made (or none at all). your function should be idempotent as names could be passed through many times.
so, for my case i could just do
myparser.optionxform = str
.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.