Dotted keys read from YAML are lost with box_dots / default_box
Open
- Dominant language
- Python
- Stars
- 2.8k
- Forks
- 135
- PR merge metrics
- No merged PRs in 30d
Description
When reading the following YAML file...
```
a.b: c
a:
d: e
```
... with `box_dots=True` and `default_box=True`, the key a.b is lost when it's in front of a:
```
>>> import box
>>> box.Box.from_yaml(filename='test.yml')
Box({'a.b': 'c', 'a': {'d': 'e'}})
>>> box.Box.from_yaml(filename='test.yml',box_dots=True,default_box=True)
Box({'a': {'d': 'e'}})
```
Having the keys in reverse works correctly:
```
>>> box.Box.from_yaml(filename='test_reverse.yml')
Box({'a': {'d': 'e'}, 'a.b': 'c'})
>>> box.Box.from_yaml(filename='test_reverse.yml',box_dots=True,default_box=True)
Box({'a': {'d': 'e', 'b': 'c'}})
```
Contributor guide
Assessment
This issue has not been assessed yet.