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

__repr__ bug in brownie console #1014

Closed
bombs-kim opened this issue Mar 24, 2021 · 1 comment · Fixed by #1057
Closed

__repr__ bug in brownie console #1014

bombs-kim opened this issue Mar 24, 2021 · 1 comment · Fixed by #1057
Labels
bug Something isn't working

Comments

@bombs-kim
Copy link

bombs-kim commented Mar 24, 2021

Environment information

  • brownie Version: 1.14.2
  • ganache-cli Version: N/A
  • solc Version: 0.6.0
  • Python Version: 3.8.5
  • OS: osx

What was wrong?

I encountered RecursionError in brownie console after executing globals() to inspect what variables there are for me to use. Here is the error message.

>>> globals()
  File "brownie/_cli/__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "brownie/_cli/console.py", line 59, in main
    shell.interact(banner="Brownie environment is ready.", exitmsg="")
  File "brownie/_cli/console.py", line 205, in interact
    super().interact(*args, **kwargs)
  File "/Users/derek/opt/miniconda3/lib/python3.8/code.py", line 232, in interact
    more = self.push(line)
  File "/Users/derek/opt/miniconda3/lib/python3.8/code.py", line 258, in push
    more = self.runsource(source, self.filename)
  File "brownie/_cli/console.py", line 250, in runsource
    self._console_write(self.locals["__ret_value__"])
  File "brownie/_cli/console.py", line 191, in _console_write
    text = color.pretty_dict(obj)
  File "brownie/utils/color.py", line 87, in pretty_dict
    text += "{" + self.pretty_dict(value[k], _indent)
  File "brownie/utils/color.py", line 87, in pretty_dict
    text += "{" + self.pretty_dict(value[k], _indent)
  File "brownie/utils/color.py", line 87, in pretty_dict
    text += "{" + self.pretty_dict(value[k], _indent)
  File line, line 983, in times]
  File "brownie/utils/color.py", line 92, in pretty_dict
    text += self._write(value[k])
  File "brownie/utils/color.py", line 120, in _write
    return f"{s}{value}{s}"
  File "<frozen, line line, in in
RecursionError: maximum recursion depth exceeded while getting the repr of an object

How can it be fixed?

I am new to brownie and not sure what specifically causes this error.

@iamdefinitelyahuman
Copy link
Member

Ahh, that's definitely a bug.

Try using dir() for now, but I'll have a look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants