name when filling in the internal data structures, otherwise we incorrectly
raise a KeyError.
This fixes SF bug #432369.
if line[0] in ' \t' and cursect is not None and optname:
value = line.strip()
if value:
- cursect[optname] = cursect[optname] + '\n ' + value
+ k = self.optionxform(optname)
+ cursect[k] = "%s\n%s" % (cursect[k], value)
# a section header or option header?
else:
# is it a section header?
cf.remove_option("a", "B")
verify(cf.options("a") == [])
+ # SF bug #432369:
+ cf = ConfigParser.ConfigParser()
+ sio = StringIO.StringIO("[MySection]\nOption: first line\n\tsecond line\n")
+ cf.readfp(sio)
+ verify(cf.options("MySection") == ["option"])
+ verify(cf.get("MySection", "Option") == "first line\nsecond line")
+
def interpolation(src):
print "Testing value interpolation..."