This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author niemeyer
Recipients
Date 2002-11-07.21:16:03
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=7887

Thanks for purposing that Detlef. Having a configuration file without 
headers could indeed be interesting in some situations. 
 
I have a few comments about the implementation: 
 
The patch includes a new parameter in read functions, stating 
what's the first section name. It means that we could have other 
sections after the first unheaded section. IMO, that situation should 
still be considered an error. 
 
One possible way to implement it is to include a "noheaders" boolean 
parameter for the constructor. Then, the user would have to know what's 
the standard single section name, to pass it to functions like get(). 
 
Another way would be to include something like a "singlesection" parameter 
in the constructor. This parameter would accept a string option, which 
would name the single section. 
 
As an argument against the whole issue, I'm not sure how unconfortable 
it is to simply include a header in the file to satisfy the parser. 
 
As an argument favorable, this could allow ConfigParser to parse simple 
(no escapes or variables) shell configuration files and other simple 
configurations using NAME=VALUE style. 
 
I'm attaching an alternative implementation of the singlesection algorithm, 
described above. Would it be enough for your needs? 
 
History
Date User Action Args
2007-08-23 15:12:29adminlinkissue549037 messages
2007-08-23 15:12:29admincreate