Yaml supports syntax for merging arrays and dictionaries. The following yaml file can be successfully loaded by using PyYAML directly:
part1: &base
a: hello
b: world
c:
obj1: ','
obj2: ['el1', 'el2']
part2:
<<: *base
b: solar system
However, when I use anyconfig to load the same file, I get an exception like this one:
...
...
...
File "/usr/local/anaconda3/envs/test/lib/python3.5/site-packages/yaml/constructor.py", line 86, in construct_object
data = constructor(self, node)
File "/usr/local/anaconda3/envs/test/lib/python3.5/site-packages/anyconfig/backend/yaml.py", line 97, in construct_mapping
key = loader.construct_object(key_node, deep=deep)
File "/usr/local/anaconda3/envs/test/lib/python3.5/site-packages/yaml/constructor.py", line 86, in construct_object
data = constructor(self, node)
File "/usr/local/anaconda3/envs/test/lib/python3.5/site-packages/yaml/constructor.py", line 414, in construct_undefined
node.start_mark)
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:merge'
in "example.yml", line 9, column 3
Yaml supports syntax for merging arrays and dictionaries. The following yaml file can be successfully loaded by using PyYAML directly:
However, when I use
anyconfig
to load the same file, I get an exception like this one:A quick search revealed that several other libraries had similar issues and apparently it is a quick fix to make this work: https://github.com/yaml/pyyaml/issues/64 https://github.com/saltstack/salt/issues/2092 https://github.com/google/rekall/issues/319 https://github.com/zerwes/hiyapyco/issues/7