vlmaksime / weather.gismeteo

Gismeteo Weather Forecast for KODI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError: 'name'

Sopor opened this issue · comments

It seems that it is broken again ☹

2023-12-20 15:08:54.359 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: Unhandled exception detected!
2023-12-20 15:08:54.359 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: *** Start diagnostic info ***
2023-12-20 15:08:54.360 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: System info: uname_result(system='Linux', node='osmc', release='4.9.269-33-osmc', version='#1 SMP PREEMPT Tue Aug 1 01:04:25 UTC 2023', machine='armv7')
2023-12-20 15:08:54.360 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: OS info: Busy
2023-12-20 15:08:54.360 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: Kodi version: 20.2
2023-12-20 15:08:54.360 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: File: /home/osmc/.kodi/addons/weather.gismeteo/resources/libs/gismeteo.py
2023-12-20 15:08:54.360 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: Code context:
                                                      95:         xml_location = root[0]
                                                      96: 
                                                      97:>        return {'name': xml_location.attrib['name'],
                                                      98:                 'id': xml_location.attrib['id'],
                                                      99:                 'kind': xml_location.attrib['kind'],
                                                   
2023-12-20 15:08:54.362 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: Global variables:
                                                   GismeteoClient = <class 'resources.libs.gismeteo.GismeteoClient'>
                                                   GismeteoError = <class 'resources.libs.gismeteo.GismeteoError'>
                                                   calendar = <module 'calendar' from '/usr/lib/python3.9/calendar.py'>
                                                   etree = <module 'xml.etree.cElementTree' from '/usr/lib/python3.9/xml/etree/cElementTree.py'>
                                                   requests = <module 'requests' from '/home/osmc/.kodi/addons/script.module.requests/lib/requests/__init__.py'>
                                                   time = <module 'time' (built-in)>
                                                   unicode_literals = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 2097152)
2023-12-20 15:08:54.362 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: Local variables:
                                                   root = <Element 'document' at 0xd6a38ed8>
                                                   self = <resources.libs.Gismeteo object at 0xd7961a18>
                                                   xml_location = <Element 'result' at 0xd6a38f00>
2023-12-20 15:08:54.363 T:2980    error <general>: weather.gismeteo [v.0.6.4+matrix.1]: **** End diagnostic info ****
2023-12-20 15:08:54.375 T:2980    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'KeyError'>
                                                   Error Contents: 'name'
                                                   Traceback (most recent call last):
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 795, in _get_cached_data
                                                       data, timestamp = cache[key]
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 381, in __getitem__
                                                       raise KeyError(key)
                                                   KeyError: "_location_forecast('en', '424'){}"
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/default.py", line 498, in <module>
                                                       weather.run()
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/resources/libs/simpleweather/simpleweather.py", line 475, in run
                                                       self._resolve_function()
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 1128, in _resolve_function
                                                       return action_callable(self._params)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/default.py", line 368, in forecast
                                                       data = _location_forecast(lang, location.id)
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 850, in inner_wrapper
                                                       return self._get_cached_data(cache, func, duration,
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 801, in _get_cached_data
                                                       data = func(*args, **kwargs)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/default.py", line 418, in _location_forecast
                                                       return _call_method(gismeteo.forecast, params)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/default.py", line 473, in _call_method
                                                       return func(**params)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/resources/libs/gismeteo.py", line 269, in forecast
                                                       return self._get_forecast_info(x)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/resources/libs/gismeteo.py", line 97, in _get_forecast_info
                                                       return {'name': xml_location.attrib['name'],
                                                   KeyError: 'name'
                                                   -->End of Python script error report<--

Update: I don't know if it was a temporary issue, but the weather is working again.