[4suite] Re: [XML-SIG] problem whith the error " ImportError: cannot import name boolean"

Uche Ogbuji uche.ogbuji@fourthought.com
26 Jul 2002 12:00:40 -0600


On Fri, 2002-07-26 at 11:42, Mike Olson wrote:
> On Fri, 2002-07-26 at 11:47, Uche Ogbuji wrote:
> > 
> > > Unfortunatly, the code I've added could
> > > cause use problems down the line unless we encourage people to do a
> > > fresh install as opposed to upgrading 4Suite.
> > 
> > Could you clarify this last sentence a bit?
> 
> Before my change there was Ft/Lib/boolean.so
> 
> After my change:
> Ft/Lib/boolean.py
> Ft/Lib/booleanc.so
> 
> boolean.py basically does from booleanc import * inside a try and
> except.
> 
> The problem is that is you upgrade, then there will be two files called
> boolean in that directory.  boolean.py and boolean.so
> 
> boolean.so will never get reinstalled, but it could get imported first.
> 
> this is not really a problem until we change boolean.c (fix a bug, add a
> feature, etc).  Inwhich case, if the old boolean.so gets imported before
> boolean.py, then the new functionality will not be available.
> 
> Also note, we cannot really get around this.  If we do anything in
> Ft/Lib/__init__.py then we hav installation issues as setup.py imports
> from Ft/Lib/DistExt in the installation directory.  At install time,
> boolean.* does not exist yet and we would get exceptions.

Can't we fix this with an import hook inside Ft/Lib/__init__.py?

I'm sure that's not clear, so I'll do a bit of experimentation and
report back.


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Track chair, XML/Web Services One Boston: http://www.xmlconference.com/
Basic XML and RDF techniques for knowledge management, Part 7 -
http://www-106.ibm.com/developerworks/xml/library/x-think12.html
Keeping pace with James Clark -
http://www-106.ibm.com/developerworks/xml/library/x-jclark.html
Python and XML development using 4Suite, Part 3: 4RDF -
http://www-105.ibm.com/developerworks/education.nsf/xml-onlinecourse-bytitle/8A1EA5A2CF4621C386256BBB006F4CEC