ConfParser.jl icon indicating copy to clipboard operation
ConfParser.jl copied to clipboard

Case of INI sections is ignored

Open dburov190 opened this issue 5 years ago • 2 comments

If an INI file has a section named [General], then calling var = retrieve(conf, "General", "var") will cause an exception (since the dictionary field of conf will have "general" as one of the keys).

It would be nice to have case-sensitive sections, but at the very least it shouldn't spit out an error, i.e. it should convert everything to lower case, for example, before trying to find a key in the internal dictionary.

dburov190 avatar Jul 01 '19 23:07 dburov190

The section names seems to be lowercased yes:

https://github.com/JuliaIO/ConfParser.jl/blob/master/src/ConfParser.jl#L109

It would probably make sense to lowercase the key when retrieving.

jonathanBieler avatar Jul 02 '19 10:07 jonathanBieler

Either that or, maybe, just leave it as it is? i.e. substitute the linked line with blockname = m.captures[1] I think it would be more standard behavior? Python's configparser does that.

dburov190 avatar Jul 02 '19 16:07 dburov190