Jeffser / Alpaca

An Ollama client made with GTK4 and Adwaita
GNU General Public License v3.0
116 stars 18 forks source link

0.9.4 | Getting FileNotFound error when creating a new chat #92

Closed BadKiko closed 3 weeks ago

BadKiko commented 3 weeks ago

Describe the bug When creating a new chat I get an error:

Traceback (most recent call last):
  File "/app/share/Alpaca/alpaca/window.py", line 1174, in <lambda>
    self.add_chat_button.connect("clicked", lambda button : self.new_chat())
                                                            ^^^^^^^^^^^^^^^
  File "/app/share/Alpaca/alpaca/window.py", line 925, in new_chat
    self.save_history()
  File "/app/share/Alpaca/alpaca/window.py", line 857, in save_history
    with open(os.path.join(self.data_dir, "chats", "chats.json"), "w+") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] Нет такого файла или каталога: '/home/kiko/.var/app/com.jeffser.Alpaca/data/chats/chats.json'
BadKiko commented 3 weeks ago

I guess when upgrading to the new version of stories, the code for creating the .json of history file was not written?

Jeffser commented 3 weeks ago

My bad, it does try to make the file, is just that the directory data_dir / chats doesn't exist and it fails on creating chats.json

I fix it

https://github.com/Jeffser/Alpaca/commit/887a7645d4d2db294fb2ab2ba45c0c39dc28235d