[Numpy-discussion] import Numeric fails with user-supplied __import__?

Mr. Bawkbugawk tommy at ilm.com
Mon May 6 11:33:02 EDT 2002

Hey Folks,

using the recently released python 2.1.3 with version 20.3 of the
Numeric package, we are getting this behavior:

(tommy at mace)/u0/tommy$ python2
Python 2.1.3 (#1, Apr 22 2002, 16:14:11) [C] on irix6
Type "copyright", "credits" or "license" for more information.
>>> import ihooks
>>> ihooks.install()
>>> import Numeric
Segmentation fault

this is happening on both irix and linux.  I checked the release notes 
for Numeric 20.1 but didn't see any mention of import bugs being
fixed.  a little bit of investigation shows that it isn't even ihooks
that causes this, it is any user-supplied __import__:

import __builtin__

class blah:
    def __init__( self ):
        self.real_importer = __builtin__.__import__
        __builtin__.__import__ = self.my_import

    def my_import( self, name, globs={}, locs={}, fromlist=[] ):
        return self.real_importer( name, globs, locs, fromlist )

_blah = blah()

859:tpelle at parro > python2
Python 2.1.3 (#1, Apr 19 2002, 21:22:42)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2
Type "copyright", "credits" or "license" for more information.
 >>> import blah
 >>> import Numeric
Segmentation fault (core dumped)

anyone out there seen this before?  any guess if its Numeric's problem 
or perhaps a bug deeper down in python's import architecture?

any and all clues appreciated, thanks!

More information about the NumPy-Discussion mailing list