[Xapian-discuss] Python segmentation fault when abstracting value range processor

James Aylett james-xapian at tartarus.org
Wed Mar 4 11:36:55 GMT 2009


On Wed, Mar 04, 2009 at 11:23:10AM +0000, Olly Betts wrote:

> Actually, another option might be to keep a reference to the Python VRP
> proxy object in the Python QueryParser proxy object.  I don't know how
> feasible that is.

That's pretty easy. We'd have to replace the registration call that
puts the Xapian VRP object into the Xapian QueryParser, something
like:

----------------------------------------------------------------------
real_add_valuerangeprocessor = QueryParser.add_valuerangeprocessor
def intercept_add_valuerangeprocessor(self, vrproc):
    self._vrps.append(vrproc)
    real_add_valuerangeprocessor(self, vrproc)
QueryParser._vrps = []
QueryParser.add_valuerangeprocessor = intercept_add_valuerangeprocessor
----------------------------------------------------------------------

in python/extra.i should do it (untested). Of course, there are other
similar situations :-/

J

-- 
  James Aylett

  talktorex.co.uk - xapian.org - uncertaintydivision.org



More information about the Xapian-discuss mailing list