After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790071 - left overs in nodeWrap() kill itstool
left overs in nodeWrap() kill itstool
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: python
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2017-11-08 15:59 UTC by Patrick Welche
Modified: 2021-07-05 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes gtk-doc 1.26 build with itstool 2.0.4 (915 bytes, patch)
2017-11-08 22:56 UTC, Patrick Welche
none Details | Review

Description Patrick Welche 2017-11-08 15:59:34 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.
Comment 1 Patrick Welche 2017-11-08 17:43:15 UTC
Better will probably be dealing with 'NoneType' as 'name'...
Comment 2 Patrick Welche 2017-11-08 22:56:26 UTC
Created attachment 363269 [details] [review]
fixes gtk-doc 1.26 build with itstool 2.0.4
Comment 3 Nick Wellnhofer 2017-11-11 20:53:17 UTC
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?
Comment 4 GNOME Infrastructure Team 2021-07-05 13:23:55 UTC
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.