[issue20923] ConfigParser should nested [] in section names.

Terry J. Reedy report at bugs.python.org
Sat Mar 15 02:16:37 CET 2014


Terry J. Reedy added the comment:

This is invalid as a bug report, unless one considers that the presence of '_foo]' on the same line should have raised an exception. As an enhancement request, I think it should be rejected.

ConfigParser configuration language is based on msdos/windows .ini files. Similar files are used on windows. "A configuration file consists of sections, each led by a [section] header," That and "The section name appears on a line by itself, in square brackets ([ and ])." from
  https://en.wikipedia.org/wiki/.ini#Sections
mark [] as delimiters. I am rather sure that no other language/system allows square brackets in the section name. If you know differently, please present evidence. Unescaped delimiters are generally not allowed between delimiters unless there is a semantic reason to have nesting, and there is not one here. Parentheses, angle brackets, and curly brackets (and more from the rest of Unicode) are available to use. The request here is similar to asking that
  'abc'cd'
be parsed as one string. Parsing nested constructs is much more complicated than parsing flat constructs.

----------
nosy: +terry.reedy
resolution:  -> rejected
stage:  -> test needed
status: open -> closed
title: ConfigParser should be greedy when parsing section name -> ConfigParser should nested [] in section names.
versions: +Python 3.5 -Python 3.3

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


More information about the Python-bugs-list mailing list