Issue 1781. Now ConfigParser.add_section does not let you add a

DEFAULT section any more, because it duplicated sections with
the rest of the machinery. Thanks Tim Lesher and Manuel Kaufmann.
This commit is contained in:
Facundo Batista 2008-02-23 12:46:10 +00:00
parent 1660933d23
commit b12f0b581a
4 changed files with 19 additions and 3 deletions

View file

@ -235,8 +235,12 @@ class RawConfigParser:
"""Create a new section in the configuration.
Raise DuplicateSectionError if a section by the specified name
already exists.
already exists. Raise ValueError if name is DEFAULT or any of it's
case-insensitive variants.
"""
if section.lower() == "default":
raise ValueError, 'Invalid section name: %s' % section
if section in self._sections:
raise DuplicateSectionError(section)
self._sections[section] = self._dict()