Skip to content
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

default_box_create_on_get is ignored with from_yaml #275

Closed
wrdls opened this issue Jul 4, 2024 · 1 comment
Closed

default_box_create_on_get is ignored with from_yaml #275

wrdls opened this issue Jul 4, 2024 · 1 comment
Labels

Comments

@wrdls
Copy link

wrdls commented Jul 4, 2024

Box b should not contain 'foo': {'bar': {}} after the get.

>>> b = Box.from_yaml('a:\n  b: c', default_box=True, default_box_create_on_get=False)
>>> b
Box({'a': {'b': 'c'}})
>>> b.foo.bar
Box({})
>>> b
Box({'a': {'b': 'c'}, 'foo': {'bar': {}}})
@cdgriffith cdgriffith added the bug label Sep 25, 2024
cdgriffith added a commit that referenced this issue Jan 15, 2025
cdgriffith added a commit that referenced this issue Jan 15, 2025
* Fixing #275 default_box_create_on_get is ignored with from_yaml (thanks to Ward Loos)
* Fixing #285 Infinite Recursion when accessing non existent list index in a DefaultBox with box_dots (thanks to Jesper Schlegel)

---------

Co-authored-by: jesperschlegel <jesperhschlegel@gmail.com>
Co-authored-by: Jesper Schlegel <jesper.schlegel@link2.ai>
@cdgriffith
Copy link
Owner

Fixed in 7.3.1 as that param was not being passed to box but to the parser itself, fixed for yaml, json and toml. Thanks for the bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants