Fixes #24142: [configparser] always join multiline values to not leave the parser in an invalid state

This commit is contained in:
Łukasz Langa 2016-11-26 14:00:39 -08:00
parent c7b1a0bbe2
commit 47a9a4beda
4 changed files with 29 additions and 1 deletions

View file

@ -1102,10 +1102,10 @@ class RawConfigParser(MutableMapping):
# raised at the end of the file and will contain a
# list of all bogus lines
e = self._handle_error(e, fpname, lineno, line)
self._join_multiline_values()
# if any parsing errors occurred, raise an exception
if e:
raise e
self._join_multiline_values()
def _join_multiline_values(self):
defaults = self.default_section, self._defaults