I would expect the following to raise a KeyError, not a BoxError:
In [17]: b = Box(box_dots=True)
In [18]: b['a.b']
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
lib64/python3.8/site-packages/box/box.py in __getitem__(self, item, _ignore_default)
487 try:
--> 488 return super().__getitem__(item)
489 except KeyError as err:
KeyError: 'a.b'
During handling of the above exception, another exception occurred:
BoxError Traceback (most recent call last)
<ipython-input-18-e8e887ae1af6> in <module>
----> 1 b['a.b']
lib64/python3.8/site-packages/box/box.py in __getitem__(self, item, _ignore_default)
493 if self._box_config["box_dots"] and isinstance(item, str) and ("." in item or "[" in item):
494 try:
--> 495 first_item, children = _parse_box_dots(self, item)
496 except BoxError:
497 if self._box_config["default_box"] and not _ignore_default:
lib64/python3.8/site-packages/box/box.py in _parse_box_dots(bx, item, setting)
91 if setting and "." in item:
92 return item.split(".", 1)
---> 93 raise BoxError("Could not split box dots properly")
94
95
BoxError: Could not split box dots properly
I would expect the following to raise a
KeyError
, not aBoxError
: