Is there any solution to force the RawConfigParser.write() method to export the config file with an alphabetical sort?
Even if the original/loaded config file is sorted, the module mixes the section and the options into the sections arbitrarily, and is really annoying to edit manually a huge unsorted config file.
PD: I’m using python 2.6
Three solutions:
write()(just copy this method from the original source and modify it).write().See this article for a ordered dict or maybe use this implementation which preserves the original adding order.