[New-bugs-announce] [issue27583] configparser: modifying default_section at runtime

rk report at bugs.python.org
Thu Jul 21 08:54:13 EDT 2016


New submission from rk:

Modifying "default_section" in the configparser at runtime does not behave as described.

The documentation says about default_section: 

When default_section is given, it specifies the name for the special section holding default values for other sections and interpolation purposes (normally named "DEFAULT"). This value can be retrieved and changed on runtime using the default_section instance attribute.
[https://docs.python.org/3/library/configparser.html]

So, if I modify default_section at runtime, the default values for other sections should then come from the new default_section. But this is not the case. Instead, the default-values still come from self._default, which was set by self._read.

So, this is either a bug in the library or a bug in the documentation.

I've attached a testcase.

----------
components: Library (Lib)
files: bug_configparser_default_section.py
messages: 270918
nosy: rk
priority: normal
severity: normal
status: open
title: configparser: modifying default_section at runtime
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43808/bug_configparser_default_section.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27583>
_______________________________________


More information about the New-bugs-announce mailing list