Message325000
All config options are converted to lowercase when they are stored. You can customise this with https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.optionxform. You can customize it more with https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour
> Note also that keys in sections are case-insensitive and stored in lowercase
>>> from configparser import ConfigParser
>>> c = ConfigParser()
>>> c["A"] = {'FOO': 'bar'}
>>> with open('example.ini', 'w') as configfile: c.write(configfile)
...
>>> with open('example.ini', 'r') as configfile: print(configfile.read())
...
[A]
foo = bar
# Don't convert to lower case
>>> d = ConfigParser()
>>> d.optionxform = str
>>> d["A"] = {'FOO': 'bar'}
>>> with open('example_case.ini', 'w') as configfile: d.write(configfile)
...
>>> with open('example_case.ini', 'r') as configfile: print(configfile.read())
...
[A]
FOO = bar
Hope this answers your question. Feel free to close this if it's clear.
Thanks |
|
Date |
User |
Action |
Args |
2018-09-11 11:15:23 | xtreak | set | recipients:
+ xtreak, philippewagnieres@hispeed.ch |
2018-09-11 11:15:23 | xtreak | set | messageid: <1536664523.07.0.0269046726804.issue31535@psf.upfronthosting.co.za> |
2018-09-11 11:15:23 | xtreak | link | issue31535 messages |
2018-09-11 11:15:22 | xtreak | create | |
|