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

Moving a contract raises FileNotFoundError #539

Closed
iamdefinitelyahuman opened this issue May 23, 2020 · 0 comments · Fixed by #545
Closed

Moving a contract raises FileNotFoundError #539

iamdefinitelyahuman opened this issue May 23, 2020 · 0 comments · Fixed by #545
Labels
bug Something isn't working

Comments

@iamdefinitelyahuman
Copy link
Member

What was wrong?

-Moving a contract source file to a different subdirectory within contracts/ raises a FileNotFoundError:

  File "eth_brownie-1.8.6-py3.8.egg/brownie/_cli/__main__.py", line 58, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "eth_brownie-1.8.6-py3.8.egg/brownie/_cli/console.py", line 44, in main
    active_project = project.load()
  File "eth_brownie-1.8.6-py3.8.egg/brownie/project/main.py", line 543, in load
    return Project(name, project_path)
  File "eth_brownie-1.8.6-py3.8.egg/brownie/project/main.py", line 154, in __init__
    self.load()
  File "eth_brownie-1.8.6-py3.8.egg/brownie/project/main.py", line 184, in load
    self._build._add(build_json)
  File "eth_brownie-1.8.6-py3.8.egg/brownie/project/build.py", line 55, in _add
    self._generate_revert_map(
  File "eth_brownie-1.8.6-py3.8.egg/brownie/project/build.py", line 76, in _generate_revert_map
    revert_str = self._sources.get(path_str)[data["offset"][1] :]
  File "eth_brownie-1.8.6-py3.8.egg/brownie/project/sources.py", line 71, in get
    with Path(key).open() as fp:
  File "/usr/lib/python3.8/pathlib.py", line 1213, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/usr/lib/python3.8/pathlib.py", line 1069, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'contracts/Token.sol'

How can it be fixed?

Consider a changed path when deciding which files to recompile.

@iamdefinitelyahuman iamdefinitelyahuman added the bug Something isn't working label May 23, 2020
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.

1 participant