On Wed, Sep 27, 2023 at 09:06:03PM +0200, Volker Schlecht wrote:
> games/unknown-horizons seems broken through games/fifengine ... I'm not a
> python
> expert, but it looks like that must have happened quite a while ago already?
> File
> "/usr/local/lib/python3.10/site-packages/fife/extensions/serializers/simplexml.py",
> line 386, in _validateTree
> for c in self._root_element.getchildren():
>
> AttributeError: 'xml.etree.ElementTree.Element' object has no attribute
> 'getchildren'
> swig/python detected a memory leak of type 'fcn::Color *', no destructor
> found.
> .
>
getchildren() was removed in Python 3.9, so this was broken for nearly
two years:
getchildren():
Deprecated since version 3.2, will be removed in version 3.9: Use
list(elem) or iteration.
https://docs.python.org/3.8/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getchildren
blindly removing the getchildren() calls fixes this, but it doesn't
help much as it runs into the next problem:
File
"/usr/local/lib/python3.10/site-packages/horizons/util/loaders/jsondecoder.py",
line 40, in load
return json.load(f, encoding="ascii", object_hook=_decode_dict)
File "/usr/local/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/local/lib/python3.10/json/__init__.py", line 359, in loads
return cls(**kw).decode(s)
TypeError: JSONDecoder.__init__() got an unexpected keyword argument 'encoding'
Might be worth at try to build fifengine from HEAD, which is what some
distros seem to be packaging without patching:
https://github.com/fifengine/fifengine/