parser = SafeConfigParser()
parser.read(config_filename)
config_section = dict(parser.items("config")) if "config" in parser else {}
other_sections = {key: value for key, value in parser.items() if key != "config" and key != "DEFAULT"}
return config_section, other_sections
After Change
other_sections = {}
for section in parser.sections():
if section != "config" and section != "DEFAULT":
other_sections[section] = dict(parser.items(section))
return config_section, other_sections
class RemoteProxy: