OpenVoiceOS / skill-ovos-weather

OpenVoiceOS official Weather Skill, providing weather conditions and forecasts.
Apache License 2.0
1 stars 4 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '/home/ovos/.cache/json_database/skill-weather-response-cache.json' #29

Closed goldyfruit closed 1 year ago

goldyfruit commented 1 year ago

When asking the temperature, sometime the plugin get stuck and error this:

2023-03-28 15:46:10.546 - skills - ovos_workshop.resource_files:_load_dialog_renderer:468 - DEBUG - No dialog loaded for en-us
2023-03-28 15:46:10.546 - skill-ovos-fallback-unknown.openvoiceos - WARNING - dialog_render is None, does the locale/dialog folder exist?
Exception in thread Thread-45:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 1394, in run
    self.function(*self.args, **self.kwargs)
  File "/home/ovos/.local/share/mycroft/skills/skill-ovos-weather.openvoiceos/skill/api.py", line 208, in clear_cache
    os.remove(self.cache_response_location.path)
FileNotFoundError: [Errno 2] No such file or directory: '/home/ovos/.cache/json_database/skill-weather-response-cache.json'
Exception in thread Thread-46:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 1394, in run
    self.function(*self.args, **self.kwargs)
  File "/home/ovos/.local/share/mycroft/skills/skill-ovos-weather.openvoiceos/skill/api.py", line 208, in clear_cache
    os.remove(self.cache_response_location.path)
FileNotFoundError: [Errno 2] No such file or directory: '/home/ovos/.cache/json_database/skill-weather-response-cache.json'
emphasize commented 1 year ago

unclear why this didn't came up earlier. Nonetheless since the cache is a JsonStorage object, instead of os.remove the handler should call clear() on the object.

goldyfruit commented 1 year ago

Thanks for taking care of it @emphasize