Message225693
| Author |
kernc |
| Recipients |
kernc |
| Date |
2014年08月22日.18:22:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1408731768.17.0.221948826268.issue22253@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
ConfigParser does not handle files that specify options in the "global" section (first option specified before any section is). This configuration "behavior" is present in the configuration files in the wild [1, 2], and while the naive workaround is simple, ... really?!
The support for section-less configuration would also play nice with various "POSIX-compatible config files" (think /etc/default/*, /etc/os-release, ...).
Ideally, the support could be enabled by default or only when `strict=False` constructor argument is supplied. The options in this global section could likely be accessed in the empty ('') section, e.g. `config.get('', 'option')`.
Thus, ConfigParser could finally really replace the venerable ConfigObj [3].
[1]: http://stackoverflow.com/a/22501121/
[2]: https://www.google.com/search?q=MissingSectionHeaderError%3A+File+contains+no+section+headers
[3]: http://www.voidspace.org.uk/python/configobj.html |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年08月22日 18:22:48 | kernc | set | recipients:
+ kernc |
| 2014年08月22日 18:22:48 | kernc | set | messageid: <1408731768.17.0.221948826268.issue22253@psf.upfronthosting.co.za> |
| 2014年08月22日 18:22:48 | kernc | link | issue22253 messages |
| 2014年08月22日 18:22:47 | kernc | create |
|