tags:

views:

36

answers:

1

Why do I have to resort to configparser.optionxform = str in order preserve case of the contents of a config file. Is it not more sane preserve by default?

+1  A: 

This only affects the case of the option names, the case of values is always preserved. It can be argued, whether this is a sane choice, but the choice has been made and must now be followed in order to maintain compatibility with old sources.

I don't see any big problem, since you obviously found a workaround for yourself. You might alternatively try configobj. It is powerful, has a much more convenient and reasonable API and does by default preserve case of options.

lunaryorn