pyhocon icon indicating copy to clipboard operation
pyhocon copied to clipboard

Merging non-root ConfigTree onto root ConfigTree fails due to lack of history attr

Open aalba6675 opened this issue 6 years ago • 0 comments

This error will surface if trying to work through @afanasev 's issue #152.

from pyhocon.config_parser import ConfigFactory as CF, ConfigParser as CP
from pyhocon.config_tree import ConfigTree as CT

root = CF.parse_string('a=1, mid.b=1')

nonroot = CF.parse_string('b=1')
nonroot.root = False
del nonroot.history
result = nonroot.with_fallback(root)
## OR
nonroot = root.get_config('mid').with_fallback(root)

pyhocon/config_tree.py", line 350, in __getattr__
    return super(ConfigTree, self).__getattr__(item)
AttributeError: 'super' object has no attribute '__getattr__'

aalba6675 avatar May 03 '18 08:05 aalba6675