pycritty
pycritty copied to clipboard
BUG: FileNotFoundError
Cannot touch a file before create the folder, so it should create a folder first then touch the file.
Interesting, does this happen on Mac only?
The .config/pycritty
directory should be created when installing the package with pip install
(see here) but I guess the code should check that again at runtime. I'll take a look when I have time, meanwhile if you want to submit a PR here are some ideas:
- In the
main
function, check ifresources.pycritty_dir
exists before doing anything, if it doesn't terminate the program with alog.error
message. - Same as before but instead of terminating the program, create the directory, log a warning and continue.
- Third option, change the
get_or_create_method
to create all the parent directories if they don't exist. It could be changed in theResource
class or maybe overriden in theConfigFile
, it should create the parent directory then call the parent class method to create the file.
The bug was found on my Intel Mac, but I also reproduced this problem on a m1 Mac, see this picture:
The folder was not created.
But when I try to install the package manually it creates a folder