[Xapian-tickets] [Xapian] #297: Python bindings `xapian.cvar` raises strange NameError in unexpected circumstances

Xapian nobody at xapian.org
Fri Sep 26 15:29:01 BST 2008


#297: Python bindings `xapian.cvar` raises strange NameError in unexpected
circumstances
---------------------+------------------------------------------------------
 Reporter:  exarkun  |        Owner:  richard 
     Type:  defect   |       Status:  new     
 Priority:  normal   |    Milestone:  1.1.0   
Component:  Other    |      Version:  SVN HEAD
 Severity:  normal   |   Resolution:          
 Keywords:           |    Blockedby:          
 Platform:  All      |     Blocking:          
---------------------+------------------------------------------------------
Changes (by richard):

  * owner:  olly => richard
  * version:  => SVN HEAD
  * milestone:  => 1.1.0


Comment:

 I'm guessing you came across this issue due to some automated discovery
 tool failing?  Normally, there would be no reason to access xapian.cvar.

 I think this is really a SWIG issue (though that doesn't mean we shouldn't
 try and fix it) - the xapian python bindings don't define cvar; it's
 something added by SWIG when making the bindings.  I'm not sure exactly
 what its purpose is - something to do with global C variables, for the
 message!  Xapian doesn't use any global variables, though, and certainly
 doesn't expose any such things through the bindings; we could possibly
 work around this problem by adding a "del cvar" to the end of the
 xapian.py file (which we can do easily without having to work out what
 SWIG is up to).  A better fix would be to fix SWIG so that cvar returns a
 more reasonable exception when accessed.

 I note that "help xapian.cvar" also raises NameError - this is also
 unhelpful.

-- 
Ticket URL: <http://trac.xapian.org/ticket/297#comment:1>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list