pyconfs
pyconfs copied to clipboard
Bug: Can't update config section to a list of sections
Example:
>>> from pyconfs import Configuration
>>> cfg = Configuration.from_dict({"a": {"b": 1}})
>>> cfg.a = [cfg.a]
This fails with a message AttributeError: Configuration a has no entry 'update_from_list'
. The issue is that the key a
does not get updated to be a ConfigurationList
instead of a Configuration
in update_entry()
:
elif isinstance(value, (list, UserList)) and _is_nested(value):
self.data.setdefault(key, ConfigurationList(name=name, _vars=self.vars))
self.data[key].update_from_list(value, source=source)