You seem to have got to the root of the issue. The alternative solution was to specify datacodes = h,
with the trailing comma to indicate it’s a list of length one. Similarly with names = temperature,
Basically, the config file parser configobj
is just a little bit cleverer than what people are expecting:
Values can also be lists. Lists are comma separated. You indicate a single member list by a trailing comma, unless you have a config spec that uses
force_list
, which implies an automatic conversion of scalar values to a single-element list.
This is compounded by the historical decision to have both singular and plural keys to represent the same semantic object. That obviously makes sense in everyday language but it’s not what someone using a computer is expecting.
It’s probably too late to change the way these config values are handled. We can’t use force_list
as above because we aren’t validating a spec, we just use whatever data comes out of the config file. I would be too nervous about the unintended consequences of changing how the data is parsed.