GNOME Bugzilla – Bug 790071
left overs in nodeWrap() kill itstool
Last modified: 2021-07-05 13:23:55 UTC
In python/libxml.py: # # converters to present a nicer view of the XPath returns # def nodeWrap(o): # TODO try to cast to the most appropriate node class name = libxml2mod.type(o) if name == "element" or name == "text": return xmlNode(_obj=o) if name == "attribute": return xmlAttr(_obj=o) if name[0:8] == "document": return xmlDoc(_obj=o) name[0:8] assumes that name will be subscriptable, which when given strange data might not be the case. None of the other cases in nodeWrap bother subscripting name. Found when building gtk-doc 1.26 with itstool 2.0.4: Error: Could not merge translations: 'NoneType' object is not subscriptable which prevents a successful build.
Better will probably be dealing with 'NoneType' as 'name'...
Created attachment 363269 [details] [review] fixes gtk-doc 1.26 build with itstool 2.0.4
I don't know much about the Python bindings, but I think the root of the problem lies elsewhere. Why is nodeWrap called with an `o` that yields None when libxml2mod.type(o) is called?
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.