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 684390 - Support registering XPath variables in Python
Support registering XPath variables in Python
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-19 17:42 UTC by Shaun McCance
Modified: 2013-03-27 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement xpathRegisterVariable for Python bindings (2.86 KB, patch)
2012-09-19 17:43 UTC, Shaun McCance
none Details | Review

Description Shaun McCance 2012-09-19 17:42:58 UTC
Attaching a patch to add support for registering variables with an XPath context in Python. I need this to fully support its:param in the upcoming ITS 2.0 specification.

This patch also removes the Py_DECREF(obj) from the end of libxml_xmlXPathObjectPtrConvert in python/types.c. I'm pretty sure this is wrong. obj is passed as an argument, and the function never increases the reference count on it, so I don't think it has a reference it should decrease. With the Py_DECREF call in place, I get random segfaults after registering a variable. Without it, everything works correctly.
Comment 1 Shaun McCance 2012-09-19 17:43:41 UTC
Created attachment 224770 [details] [review]
Implement xpathRegisterVariable for Python bindings
Comment 2 Daniel Veillard 2013-03-27 08:15:45 UTC
   sorry for the delay :-\

Okay, looks sane, and my own regtests seems to work, so applied and pushed,

https://git.gnome.org/browse/libxml2/commit/?id=519bc6a3ab82445a8719f548d0450efe02cc9c82

  thanks Shaun !

Daniel