New submission from Hans-Peter Jansen: ConfigParser fails in interesting ways, when using default_section and ExtendedInterpolation options. Running the attached script results in:
ConfigParser() with expected result: global: [('loglevel', 'WARNING'), ('logfile', '-')] section1: [('key_a', 'value'), ('key_b', 'morevalue')] section2: [('key_c', 'othervalue'), ('key_d', 'differentvalue')] ConfigParser(default_section='global') mangles section separation: section1: [('loglevel', 'WARNING'), ('logfile', '-'), ('key_a', 'value'), ('key_b', 'morevalue')] section2: [('loglevel', 'WARNING'), ('logfile', '-'), ('key_c', 'othervalue'), ('key_d', 'differentvalue')] ConfigParser(interpolation=ExtendedInterpolation) fails with strange error: Traceback (most recent call last): File "configparser-test.py", line 36, in <module> print_sections(cp) File "configparser-test.py", line 21, in print_sections cp.read_string(__doc__) File "/usr/lib64/python3.4/configparser.py", line 696, in read_string self.read_file(sfile, source) File "/usr/lib64/python3.4/configparser.py", line 691, in read_file self._read(f, source) File "/usr/lib64/python3.4/configparser.py", line 1089, in _read self._join_multiline_values() File "/usr/lib64/python3.4/configparser.py", line 1101, in _join_multiline_values name, val) TypeError: before_read() missing 1 required positional argument: 'value' while it is expected to behave identical. ---------- components: Library (Lib) files: configparser-test.py messages: 264031 nosy: frispete priority: normal severity: normal status: open title: ConfigParser parsing failures with default_section and ExtendedInterpolation options versions: Python 3.4 Added file: http://bugs.python.org/file42573/configparser-test.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26831> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com