[Python-checkins] r60976 - in python/trunk: Doc/library/configparser.rst Lib/ConfigParser.py Lib/test/test_cfgparser.py Misc/NEWS

Fred Drake fdrake at acm.org
Sat Feb 23 19:19:08 CET 2008


On Feb 23, 2008, at 7:46 AM, facundo.batista wrote:
> 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.

That's a good catch; thanks!

> Modified: python/trunk/Doc/library/configparser.rst
...
> +   already exists, :exc:`DuplicateSectionError` is raised. If the  
> name
> +   ``DEFAULT`` (or any of it's case-insensitive variants) is passed,
> +   :exc:`ValueError` is raised.

Why are we concerned about the case-insensitive variants?  Section  
names are not case-folded, as option names are by default.  There are  
also no ways to control the interpretation of section names, so I  
think checking only for "DEFAULT" is sufficient.

If a config file contains a [default] section, that's currently loaded  
and accessible.


   -Fred

-- 
Fred Drake   <fdrake at acm.org>






More information about the Python-checkins mailing list