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

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


On Wed, Mar 04, 2009 at 10:56:17AM +0000, Simon Roe wrote:
> def load_queryparser():
>   q = xapian.QueryParser()
>   q.set_default_op(xapian.Query.OP_AND)
> 
>   vrp = xapian.NumberValueRangeProcessor(1,'year:')
>   q.add_valuerangeprocessor(vrp)
> 
>   return q

vrp will be deleted by the python layer. This perhaps isn't what we
want, but is what is happening right now. You can make this work by
returning (q, vrp) and assigning the tuple to (qp, vrp) in the rest of
the code.

Verified with something reasonably trunky (Richard's geo branch from
around the start of the year is what I have installed on my dev
machine, it seems). ISTR that we have a way of tackling this kind of
problem, but I could be misremembering. If no one else pipes up, I'll
add it to trac.

J

-- 
  James Aylett

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



More information about the Xapian-discuss mailing list