# Python3 configparser bugreport # # Author: rk@simple-is-better.org import configparser cfg = configparser.ConfigParser() cfg.read_string(""" [DEFAULT] a=1 [FOO] a=100 [TEST] b=2 """) print(cfg.get("TEST", "a")) # -> 1, works as expected print(cfg.get("TEST", "b")) # -> 2, works as expected # according to the documentation, default_section may be modified on runtime cfg.default_section="FOO" print(cfg.get("TEST", "a")) # FAIL: got 1, expected 100