Łukasz Langa <luk...@langa.pl> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33333>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to