Trying to save a file to a directory that does not exist in .thought_box (e.g., nonexistent/.file.txt) triggers the popup [Errno 2: No such file or directory : '<directory-name>'. After closing the app, restarting triggers the same error because editor.py tries to read the nonexistent path when the ThoughtBox instance is created. I don't know how to reset the application state when this happens.
Recommended fixes:
In save_file_as_path, add a condition verifying the dirname of the user's entered path either exists or is the empty string (for a file saved at the top level in .thought_box.
Add an error handler to ThoughtBox's __init__ to display an empty file if self.application_state.current_path can't be read.
Trying to save a file to a directory that does not exist in .thought_box (e.g.,
nonexistent/.file.txt
) triggers the popup[Errno 2: No such file or directory : '<directory-name>'
. After closing the app, restarting triggers the same error becauseeditor.py
tries to read the nonexistent path when theThoughtBox
instance is created. I don't know how to reset the application state when this happens.Recommended fixes:
save_file_as_path
, add a condition verifying the dirname of the user's entered path either exists or is the empty string (for a file saved at the top level in.thought_box
.ThoughtBox
's__init__
to display an empty file ifself.application_state.current_path
can't be read.