Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:
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 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31535> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com