[New-bugs-announce] [issue33333] ConfigParser.items returns items present in `DEFAULTSECT` when section argument given.

Chris Bradbury report at bugs.python.org
Sun Apr 22 07:20:36 EDT 2018


New submission from Chris Bradbury <viff3000 at gmail.com>:

According to `ConfigParser.items` docs:

> When section is not given, return a list of section_name, section_proxy pairs, including DEFAULTSECT.

> Otherwise, return a list of name, value pairs for the options in the given section. Optional arguments have the same meaning as for the get() method.

https://docs.python.org/3/library/configparser.html#configparser.ConfigParser.items

However due to `d = self._defaults.copy()` on line 843 of configparser.py the default section is always included, even when a section argument is specified.

----------
messages: 315608
nosy: chrBrd
priority: normal
severity: normal
status: open
title: ConfigParser.items returns items present in `DEFAULTSECT` when section argument given.
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33333>
_______________________________________


More information about the New-bugs-announce mailing list