question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Box upgrade in 3.1.0 causes DynaBox signature change and broke existing code

See original GitHub issue

Hi @rochacbruno

Describe the bug

I was using the following code in an existing module, and the 3.1.0 release causes an error due to 0e4752a979be8cd5f872a06d049886e589dc7da8 (59be115724f9d973229bc8e1b884a3ae3e4f9bd5) updating Box, which now requires the box_settings keyword argument.

>       data = DynaBox(settings.as_dict(internal=False))
E       TypeError: __new__() missing 1 required keyword-only argument: 'box_settings'

To Reproduce

pip install dynaconf==3.1.0
# contents of error.py
from dynaconf import settings
from dynaconf.utils.boxing import DynaBox

data = DynaBox(settings.as_dict())
# Traceback python error.py
(dynaconf) ➜  dynaconf git:(master) ✗ python error.py 
Traceback (most recent call last):
  File "error.py", line 5, in <module>
    data = DynaBox(settings.as_dict())
TypeError: __new__() missing 1 required keyword-only argument: 'box_settings'
(dynaconf) ➜  dynaconf git:(master) ✗ pip list
Package    Version
---------- -------
dynaconf   3.1.0
pip        20.1
setuptools 46.1.3
wheel      0.34.2

Expected behavior

Should I add a default argument for box_settings for dynaconf versions >=3.1.0? Is DynaBox considered private? Or is this a bug and will DynaBox provide a default argument for box_settings in Box.__new__?

Cheers, Andreas 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
JacobCallahancommented, Aug 17, 2020

This may be related to what I just hit.

...
 File "/home/jake/Programming/venvbroker/lib64/python3.8/site-packages/broker/settings.py", line 3, in <module>
    from dynaconf import Dynaconf, Validator
  File "/home/jake/Programming/venvbroker/lib64/python3.8/site-packages/dynaconf/__init__.py", line 6, in <module>
    from dynaconf.base import LazySettings  # noqa
  File "/home/jake/Programming/venvbroker/lib64/python3.8/site-packages/dynaconf/base.py", line 9, in <module>
    from dynaconf import default_settings
  File "/home/jake/Programming/venvbroker/lib64/python3.8/site-packages/dynaconf/default_settings.py", line 10, in <module>
    from dynaconf.utils.parse_conf import parse_conf_data
  File "/home/jake/Programming/venvbroker/lib64/python3.8/site-packages/dynaconf/utils/parse_conf.py", line 11, in <module>
    from dynaconf.utils.boxing import DynaBox
  File "/home/jake/Programming/venvbroker/lib64/python3.8/site-packages/dynaconf/utils/boxing.py", line 6, in <module>
    from dynaconf.vendor.box import Box
  File "/home/jake/Programming/venvbroker/lib64/python3.8/site-packages/dynaconf/vendor/box/__init__.py", line 7, in <module>
    from box.box import Box
ModuleNotFoundError: No module named 'box.box'; 'box' is not a package
1reaction
rochacbrunocommented, Aug 21, 2020

@ap-- Your title is fine!

We have 2 problems here:

  1. You should be able to instantiate DynaBox without passing a box_settings argument.
  2. If python-box is installed in the system (externally) it overrides the vendored version

I will work on fixing it ASAP

Read more comments on GitHub >

github_iconTop Results From Across the Web

[bug] Box upgrade in 3.1.0 causes DynaBox signature change ...
Hi @rochacbruno. Describe the bug. I was using the following code in an existing module, and the 3.1.0 release causes an error due...
Read more >
https://raw.githubusercontent.com/rochacbruno/dyna...
[Bruno Rocha] Shortlog of commits since last release: Bruno Rocha (4): Release version 3.1.8 Bye py 3.7 Multiple fixes for 3.19 (#756) update...
Read more >
Untitled
How big is a bull shark, Screen printing business forum, ... Falling angels breaking benjamin, Puppycursus zeist, Smart source 11/2/14, Thermisol eps 300?...
Read more >
Change signature | IntelliJ IDEA Documentation - JetBrains
In-place refactoring is available. The Change Signature refactoring combines several modifications that can be applied to a method signature or a class ...
Read more >
vocab
345 uk 346 symptoms 347 do 348 illinois 349 source 350 los 351 aol 352 ... 1783 20 1784 passport 1785 change 1786...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found