Message226827
| Author |
kernc |
| Recipients |
gvanrossum, kernc, lukasz.langa, martin.panter, paul.moore, terry.reedy, tshepang |
| Date |
2014年09月12日.16:46:14 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CAFh6oAwFZAoyhtVcfj=sR9QasMxFR_GwzH-s_jM+FmA4Pyuo8Q@mail.gmail.com> |
| In-reply-to |
<1410236982.38.0.669278662648.issue22253@psf.upfronthosting.co.za> |
| Content |
>
> I am dubious that there are any with a mixture of both sections and
> additional option lines at the top without a section.
>
rsyncd.conf [1] is one such example, and I wouldn't say there aren't
countless more in the wild.
> Anyone writing an app and planning to parse a .ini file can add [Start] or
> [Setup] at the top.
>
Indeed. Here lies the problem of this unfortunate issue:
MissingSectionHeaderError is only ever caught [9] to mitigate this **awful
default behavior** and attach a dummy section at the top, as you say. Or
can anyone care to propose another relevant use case for this poorly (un-)
thought through exception?
> I think a more useful new configparser feature would be to keep comment
> lines and write them back out after a configuration is changed.
>
While this is very much off-topic, configobj [3] does too seem to have done
so since ages. |
|