[issue27583] configparser: modifying default_section at runtime

2016-11-19 Thread R. David Murray

Changes by R. David Murray :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27583] configparser: modifying default_section at runtime

2016-11-19 Thread Wolfgang Maier

Wolfgang Maier added the comment:

Well, you *can* change the value at runtime as you are demonstrating in your 
script, but you are misunderstanding the effect this will have. It *won't* 
cause a reevaluation of an already parsed config file. Instead it will affect 
the writing of the parsed settings to a new config file.
This is explained a bit further up in the documentation of the module:
https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour
where it says: "Its current value can be retrieved using the 
parser_instance.default_section attribute and may be modified at runtime (i.e. 
to convert files from one format to another)."

So maybe this hint could be repeated in the actual parameter description of 
https://docs.python.org/3/library/configparser.html#configparser-objects to 
avoid confusion, but I don't think there is a bug here.

--
nosy: +wolma

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27583] configparser: modifying default_section at runtime

2016-07-21 Thread R. David Murray

R. David Murray added the comment:

We use the versions field to indicate which versions it might get fixed in.  
Since this is not a security issue, that would be 3.5 and 3.6, if it doesn't 
affect 2.7.  If we decide to make the code match the docs, it will probably 
only get fixed in 3.6, since it is a behavior change.

--
nosy: +r.david.murray
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27583] configparser: modifying default_section at runtime

2016-07-21 Thread rk

Changes by rk :


Removed file: 
http://bugs.python.org/file43815/bug_configparser_default_section.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27583] configparser: modifying default_section at runtime

2016-07-21 Thread rk

rk added the comment:

Verified/tested with Python 2.7.9, 3.2.6, 3.3.6, 3.4.2, 3.5.1.
The bug exists in all versions, so I've added 3.2, 3.3, 3.4 again.

I've also attached an updated testcase, which now works in both Python 2 and 
Python 3.

--
versions: +Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file43815/bug_configparser_default_section.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27583] configparser: modifying default_section at runtime

2016-07-21 Thread rk

rk added the comment:

(removed Python 2.7, since default_section was not supported there)

--
versions:  -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27583] configparser: modifying default_section at runtime

2016-07-21 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +lukasz.langa
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27583] configparser: modifying default_section at runtime

2016-07-21 Thread rk

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com