New submission from Tim Lesher:

ConfigParser doesn't prevent "manually" adding a section named DEFAULT;
however, doing so creates a duplicate, inaccessible [DEFAULT] section in
the config file:
----
>>> import sys, ConfigParser
>>> c = ConfigParser.ConfigParser()
>>> c.add_section('DEFAULT')
>>> c.write(sys.stdout)
[DEFAULT]

>>> c.set('DEFAULT', 'color', 'yellow')
>>> c.write(sys.stdout)
[DEFAULT]
color = yellow

[DEFAULT]

----
It seems that the correct thing to do would be to disallow
add_section('DEFAULT').

----------
components: Library (Lib)
messages: 59652
nosy: tlesher
severity: normal
status: open
title: ConfigParser: add_section('DEFAULT') causes duplicate sections.
type: behavior
versions: Python 2.6

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1781>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to