-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault (infinite recursion?) when loading YAML schema into Box with box_dots=True
#265
Comments
Confirmed with that file the behavior, with both ruamel.yaml and pyyaml as backends, so is from something in my code side looping. Thanks for raising the issue will look into! |
Anything new on this one? I have a similar problem but with some JSON: Box.from_yaml(resp.text, box_dots=True)
Traceback (most recent call last):
File ".../pydevd_asyncio_utils.py", line 117, in _exec_async_code
result = func()
File "<input>", line 1, in <module>
File "box/box.py", line 1050, in box.box.Box.from_yaml
File "box/box.py", line 291, in box.box.Box.__init__
File "box/box.py", line 671, in box.box.Box.__setitem__
File "box/box.py", line 574, in box.box.Box.__convert_and_store
File "box/box.py", line 291, in box.box.Box.__init__
File "box/box.py", line 671, in box.box.Box.__setitem__
File "box/box.py", line 583, in box.box.Box.__convert_and_store
File "box/box_list.py", line 52, in box.box_list.BoxList.__init__
File "box/box_list.py", line 110, in box.box_list.BoxList.append
File "box/box_list.py", line 100, in box.box_list.BoxList._convert
File "box/box.py", line 291, in box.box.Box.__init__
File "box/box.py", line 671, in box.box.Box.__setitem__
File "box/box.py", line 574, in box.box.Box.__convert_and_store
File "box/box.py", line 291, in box.box.Box.__init__
File "box/box.py", line 671, in box.box.Box.__setitem__
File "box/box.py", line 574, in box.box.Box.__convert_and_store
File "box/box.py", line 291, in box.box.Box.__init__
File "box/box.py", line 664, in box.box.Box.__setitem__
box.exceptions.BoxKeyError: "'<class 'box.box.Box'>' object has no attribute tenant" |
I am pretty sure ...
metadata:
labels:
kubed.appscode.com/origin.cluster: unicorn
... Traceback (most recent call last):
File "/home/schroederp/.local/share/JetBrains/IntelliJIdea2024.1/python/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
File "<input>", line 1, in <module>
File "box/box.py", line 303, in box.box.Box.__init__
File "box/box.py", line 671, in box.box.Box.__setitem__
File "box/box.py", line 574, in box.box.Box.__convert_and_store
File "box/box.py", line 291, in box.box.Box.__init__
File "box/box.py", line 671, in box.box.Box.__setitem__
File "box/box.py", line 574, in box.box.Box.__convert_and_store
File "box/box.py", line 291, in box.box.Box.__init__
File "box/box.py", line 664, in box.box.Box.__setitem__
box.exceptions.BoxKeyError: "'<class 'box.box.Box'>' object has no attribute kubed" |
@paulschroeder-tomtom good find, yes. If there are keys with For example in @brynpickering YAML has keys like I don't see any what Box could really support those cases, but should at least have a check on box creation if something is going to break it like that and give a clear error. |
Ok, I sad but then it is like that. WIll you create an improve on the error message? |
I have a YAML schema (see here) which I want to be able to get the flattened dict keys for - something that
Box
is well placed to provide with its dot notation.However, I get a segfault when loading the YAML file with:
It loads successfully with:
But then I lose the ability to inspect the flattened keys (
schema.keys(dotted=True)
).The text was updated successfully, but these errors were encountered: