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 fhoech
Recipients fhoech
Date 2015-05-07.15:54:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431014086.96.0.315028213592.issue24142@psf.upfronthosting.co.za>
In-reply-to
Content
If a ParsingError occurs while reading a config file, the multi-line values collected while reading will never be joined because the error is raised before this can happen. This leads to very unexpected results, e.g. consider the following config.ini:

[DEFAULT]
test = test
invalid

>>> cfg = ConfigParser.ConfigParser()
>>> cfg.read(['config.ini'])

This will raise a ParsingError as expected. But the option values that were parsed without error are now all lists instead of strings:

>>> cfg.get('DEFAULT', test')
['test']

Patch attached.
History
Date User Action Args
2015-05-07 15:54:47fhoechsetrecipients: + fhoech
2015-05-07 15:54:46fhoechsetmessageid: <1431014086.96.0.315028213592.issue24142@psf.upfronthosting.co.za>
2015-05-07 15:54:46fhoechlinkissue24142 messages
2015-05-07 15:54:46fhoechcreate