vlmaksime / weather.gismeteo

Gismeteo Weather Forecast for KODI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xml.etree.ElementTree.ParseError: mismatched tag: line 6, column 2

Sopor opened this issue · comments

I got this error when going to the home screen:

2021-09-27 16:07:38.092 T:5225     INFO <general>: WEATHER: Downloading weather
2021-09-27 16:07:38.095 T:5228     INFO <general>: initializing python engine.
2021-09-27 16:07:42.952 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: Unhandled exception detected!
2021-09-27 16:07:42.952 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: *** Start diagnostic info ***
2021-09-27 16:07:43.015 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: System info: uname_result(system='Linux', node='osmc', release='4.9.113-45-osmc', version='#1 SMP PREEMPT Sun Aug 8 03:43:54 UTC 2021', machine='armv7', processor='')
2021-09-27 16:07:43.015 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: OS info: Busy
2021-09-27 16:07:43.015 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: Kodi version: 19.1
2021-09-27 16:07:43.015 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: File: /usr/lib/python3.7/xml/etree/ElementTree.py
2021-09-27 16:07:43.016 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: Code context:
                                                    1313:     if not parser:
                                                    1314:         parser = XMLParser(target=TreeBuilder())
                                                    1315:>    parser.feed(text)
                                                    1316:     return parser.close()
                                                    1317: 
                                                   
2021-09-27 16:07:43.021 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: Global variables:
                                                   Comment = <function Comment at 0xdc0e7270>
                                                   Element = <class 'xml.etree.ElementTree.Element'>
                                                   ElementPath = <module 'xml.etree.ElementPath' from '/usr/lib/python3.7/xml/etree/ElementPath.py'>
                                                   ElementTree = <class 'xml.etree.ElementTree.ElementTree'>
                                                   HTML_EMPTY = {'area',
                                                    'base',
                                                    'basefont',
                                                    'br',
                                                    'col',
                                                    'frame',
                                                    'hr',
                                                    'img',
                                                    'input',
                                                    'isindex',
                                                    'link',
                                                    'meta',
                                                    'param'}
                                                   PI = <function ProcessingInstruction at 0xdc0e72b8>
                                                   ParseError = <class 'xml.etree.ElementTree.ParseError'>
                                                   ProcessingInstruction = <function ProcessingInstruction at 0xdc0e72b8>
                                                   QName = <class 'xml.etree.ElementTree.QName'>
                                                   SubElement = <built-in function SubElement>
                                                   TreeBuilder = <class 'xml.etree.ElementTree.TreeBuilder'>
                                                   VERSION = '1.3.0'
                                                   XML = <function XML at 0xdc0e7ed0>
                                                   XMLID = <function XMLID at 0xdc0e80c0>
                                                   XMLParser = <class 'xml.etree.ElementTree.XMLParser'>
                                                   XMLPullParser = <class 'xml.etree.ElementTree.XMLPullParser'>
                                                   _Element_Py = <class 'xml.etree.ElementTree.Element'>
                                                   _ListDataStream = <class 'xml.etree.ElementTree._ListDataStream'>
                                                   _escape_attrib = <function _escape_attrib at 0xdc0e7b70>
                                                   _escape_attrib_html = <function _escape_attrib_html at 0xdc0e7bb8>
                                                   _escape_cdata = <function _escape_cdata at 0xdc0e7b28>
                                                   _get_writer = <function _get_writer at 0xdc0e7930>
                                                   _namespace_map = {'http://purl.org/dc/elements/1.1/': 'dc',
                                                    'http://schemas.xmlsoap.org/wsdl/': 'wsdl',
                                                    'http://www.w3.org/1999/02/22-rdf-syntax-ns#': 'rdf',
                                                    'http://www.w3.org/1999/xhtml': 'html',
                                                    'http://www.w3.org/2001/XMLSchema': 'xs',
                                                    'http://www.w3.org/2001/XMLSchema-instance': 'xsi',
                                                    'http://www.w3.org/XML/1998/namespace': 'xml'}
                                                   _namespaces = <function _namespaces at 0xdc0e7978>
                                                   _raise_serialization_error = <function _raise_serialization_error at 0xdc0e7ae0>
                                                   _sentinel = ['sentinel']
                                                   _serialize = {'html': <function _serialize_html at 0xdc0e7a08>,
                                                    'text': <function _serialize_text at 0xdc0e7a50>,
                                                    'xml': <function _serialize_xml at 0xdc0e79c0>}
                                                   _serialize_html = <function _serialize_html at 0xdc0e7a08>
                                                   _serialize_text = <function _serialize_text at 0xdc0e7a50>
                                                   _serialize_xml = <function _serialize_xml at 0xdc0e79c0>
                                                   collections = <module 'collections' from '/usr/lib/python3.7/collections/__init__.py'>
                                                   contextlib = <module 'contextlib' from '/usr/lib/python3.7/contextlib.py'>
                                                   dump = <function dump at 0xdc0e7df8>
                                                   fromstring = <function XML at 0xdc0e7ed0>
                                                   fromstringlist = <function fromstringlist at 0xdc0e8108>
                                                   io = <module 'io' from '/usr/lib/python3.7/io.py'>
                                                   iselement = <function iselement at 0xdc0d54b0>
                                                   iterparse = <function iterparse at 0xdc0e7e88>
                                                   parse = <function parse at 0xdc0e7e40>
                                                   re = <module 're' from '/usr/lib/python3.7/re.py'>
                                                   register_namespace = <function register_namespace at 0xdc0e7a98>
                                                   sys = <module 'sys' (built-in)>
                                                   tostring = <function tostring at 0xdc0e7c00>
                                                   tostringlist = <function tostringlist at 0xdc0e7c48>
                                                   warnings = <module 'warnings' from '/usr/lib/python3.7/warnings.py'>
2021-09-27 16:07:43.022 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: Local variables:
                                                   parser = <xml.etree.ElementTree.XMLParser object at 0xd58eac00>
                                                   text = (b'<?xml version="1.0" encoding="utf-8"?><weather><html>\r\n<head><title>502 '
                                                    b'Bad Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad '
                                                    b'Gateway</h1></center>\r\n<hr><center>openresty</center>\r\n</body>\r\n</ht'
                                                    b'ml>\r\n</weather>\n')
2021-09-27 16:07:43.022 T:5228    ERROR <general>: weather.gismeteo [v.0.6.2+matrix.1]: **** End diagnostic info ****
2021-09-27 16:07:43.035 T:5228    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'xml.etree.ElementTree.ParseError'>
                                                   Error Contents: mismatched tag: line 6, column 2
                                                   Traceback (most recent call last):
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 794, in _get_cached_data
                                                       raise KeyError
                                                   KeyError
                                                   
                                                   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 1125, in _resolve_function
                                                       return action_callable(self._params)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/default.py", line 364, in forecast
                                                       data = _location_forecast(lang, location.id)
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 848, in inner_wrapper
                                                       *args, **kwargs)
                                                     File "/home/osmc/.kodi/addons/script.module.simpleplugin3/libs/simpleplugin.py", line 798, in _get_cached_data
                                                       data = func(*args, **kwargs)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/default.py", line 415, in _location_forecast
                                                       return _call_method(gismeteo.forecast, params)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/default.py", line 472, in _call_method
                                                       return func(**params)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/resources/libs/gismeteo.py", line 262, in forecast
                                                       x = self._extract_xml(r)
                                                     File "/home/osmc/.kodi/addons/weather.gismeteo/resources/libs/gismeteo.py", line 42, in _extract_xml
                                                       x = etree.fromstring(r.content)
                                                     File "/usr/lib/python3.7/xml/etree/ElementTree.py", line 1315, in XML
                                                       parser.feed(text)
                                                     File "<string>", line None
                                                   xml.etree.ElementTree.ParseError: mismatched tag: line 6, column 2
                                                   -->End of Python script error report<--

Fixed in version 0.6.3. You can download it manually from the releases or wait until the changes will be merged into the official repository.

0.6.3 update was merged into official repository