When reading a continuation line, make sure we still use the transformed

name when filling in the internal data structures, otherwise we incorrectly
raise a KeyError.

This fixes SF bug #432369.
This commit is contained in:
Fred Drake 2001-07-06 17:22:48 +00:00
parent 45c23e61d8
commit beb6713ea7
2 changed files with 9 additions and 1 deletions

View file

@ -431,7 +431,8 @@ class ConfigParser:
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?