from pyhocon import ConfigFactory
if __name__ == '__main__':
c = """
args = "A"
job_args: ${nested-args}
nested-args {
norm: ${?args}
}
job_args: ${nested-args}
nested-args {
norm: ${?args}
}
"""
config = ConfigFactory.parse_string(c)
inner_config = config.get('job_args')
print(inner_config)
config.as_plain_ordered_dict()
It's producing this output with 0.3.60:
ConfigTree([('norm', [ConfigValues: [ConfigSubstitution: args]])])
Traceback (most recent call last):
File "/.../config_t.py", line 22, in <module>
config.as_plain_ordered_dict()
File "/.../venv/lib/python3.8/site-packages/pyhocon/config_tree.py", line 455, in as_plain_ordered_dict
return OrderedDict((key.strip('"'), plain_value(value)) for key, value in self.items())
File "/.../venv/lib/python3.8/site-packages/pyhocon/config_tree.py", line 455, in <genexpr>
return OrderedDict((key.strip('"'), plain_value(value)) for key, value in self.items())
File "/.../venv/lib/python3.8/site-packages/pyhocon/config_tree.py", line 449, in plain_value
return v.as_plain_ordered_dict()
File "/.../venv/lib/python3.8/site-packages/pyhocon/config_tree.py", line 455, in as_plain_ordered_dict
return OrderedDict((key.strip('"'), plain_value(value)) for key, value in self.items())
File "/.../venv/lib/python3.8/site-packages/pyhocon/config_tree.py", line 455, in <genexpr>
return OrderedDict((key.strip('"'), plain_value(value)) for key, value in self.items())
File "/.../venv/lib/python3.8/site-packages/pyhocon/config_tree.py", line 452, in plain_value
raise ConfigException("The config tree contains unresolved elements")
pyhocon.exceptions.ConfigException: The config tree contains unresolved elements
Given this config and it's parsing:
It's producing this output with 0.3.60:
With 0.3.59 it's working fine:
It seems to be introduced with this change: https://github.com/chimpler/pyhocon/pull/287