This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author frispete
Recipients frispete
Date 2016-04-22.22:37:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1461364657.99.0.761573071574.issue26831@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-04-22 22:37:38frispetesetrecipients: + frispete
2016-04-22 22:37:37frispetesetmessageid: <1461364657.99.0.761573071574.issue26831@psf.upfronthosting.co.za>
2016-04-22 22:37:37frispetelinkissue26831 messages
2016-04-22 22:37:37frispetecreate