Please include information like:
When running brownie init ~/parent-folder-doesn't-exist/child, brownie init will fail because of the default behaviour of Path.mkdir. (e.g. see this stackoverflow question)
C:\WINDOWS\system32>brownie init C:\Users\Chris\Documents\Brownie
INFO: Could not find files for the given pattern(s).
Brownie v1.14.6 - Python development framework for Ethereum
File "c:\users\chris\appdata\local\programs\python\python39\lib\site-packages\brownie\_cli\__main__.py", line 64, in main
importlib.import_module(f"brownie._cli.{cmd}").main()
File "c:\users\chris\appdata\local\programs\python\python39\lib\site-packages\brownie\_cli\init.py", line 31, in main
path = project.new(args["<path>"] or ".", args["--force"], args["--force"])
File "c:\users\chris\appdata\local\programs\python\python39\lib\site-packages\brownie\project\main.py", line 583, in new
_create_folders(project_path)
File "c:\users\chris\appdata\local\programs\python\python39\lib\site-packages\brownie\project\main.py", line 920, in _create_folders
project_path.joinpath(path).mkdir(exist_ok=True)
File "c:\users\chris\appdata\local\programs\python\python39\lib\pathlib.py", line 1313, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\Chris\\Documents\\Brownie\\build'
How can it be fixed?
This can be fixed by changing line 920 in brownie/project/main.py
from:
project_path.joinpath(path).mkdir(exist_ok=True)
to:
project_path.joinpath(path).mkdir(exist_ok=True, parents=True)
Environment information
brownie
Version: 1.14.6ganache-cli
Version: 6.12.2 (irrelevant tho)solc
Version: 0.7.3 (irrelevant)What was wrong?
Please include information like: When running
brownie init ~/parent-folder-doesn't-exist/child
,brownie init
will fail because of the default behaviour of Path.mkdir. (e.g. see this stackoverflow question)How can it be fixed?
This can be fixed by changing line 920 in brownie/project/main.py from:
project_path.joinpath(path).mkdir(exist_ok=True)
to:project_path.joinpath(path).mkdir(exist_ok=True, parents=True)