Message 315629 - Python tracker

Message315629

Author lukasz.langa
Recipients chrBrd, lukasz.langa
Date 2018-04-22.21:38:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524433097.92.0.682650639539.issue33333@psf.upfronthosting.co.za>
In-reply-to
Content
See line 379 in configparser.py. BasicInterpolation is also assumed to work for values from the default section.  This is why the default section exists in the first place.

More importantly, as you're pointing out, even though this is an omission of the documentation, existing code in the wild probably assumes that `items()` include pairs from the default section.  This is how ConfigParser worked in Python 2.  If you don't want this behavior, use cfgparser[section].items() instead which does what you want.

If you think this is helpful, go ahead and extend the documentation of ConfigParser.items() to point out this weirdness.  But we won't be going forward with PR 6567.
History
Date User Action Args
2018-04-22 21:38:17lukasz.langasetrecipients: + lukasz.langa, chrBrd
2018-04-22 21:38:17lukasz.langasetmessageid: <1524433097.92.0.682650639539.issue33333@psf.upfronthosting.co.za>
2018-04-22 21:38:17lukasz.langalinkissue33333 messages
2018-04-22 21:38:17lukasz.langacreate