[NumPy-Tickets] [NumPy] #1787: ctypeslib test error on python 3.2

NumPy Trac numpy-tickets@scipy....
Tue Mar 29 02:05:05 CDT 2011

#1787: ctypeslib test error on python 3.2
 Reporter:  matthew.brett  |       Owner:  somebody   
     Type:  defect         |      Status:  new        
 Priority:  normal         |   Milestone:  Unscheduled
Component:  Other          |     Version:  devel      
 Keywords:                 |  
 nosetests tmp/junk/lib/python3.2/site-


 ERROR: Failure: OSError (/home/mb312/tmp/junk/lib/python3.2/site-
 packages/numpy/core/multiarray.pyd: cannot open shared object file: No
 such file or directory)
 Traceback (most recent call last):
   File "/usr/local/lib/python3.2/dist-
 packages/nose-1.0.0-py3.2.egg/nose/failure.py", line 37, in runTest
     raise self.exc_class(self.exc_val).with_traceback(self.tb)
   File "/usr/local/lib/python3.2/dist-
 packages/nose-1.0.0-py3.2.egg/nose/loader.py", line 390, in
     addr.filename, addr.module)
   File "/usr/local/lib/python3.2/dist-
 packages/nose-1.0.0-py3.2.egg/nose/importer.py", line 39, in
     return self.importFromDir(dir_path, fqname)
   File "/usr/local/lib/python3.2/dist-
 packages/nose-1.0.0-py3.2.egg/nose/importer.py", line 86, in importFromDir
     mod = load_module(part_fqname, fh, filename, desc)
   File "/home/mb312/tmp/junk/lib/python3.2/site-
 packages/numpy/tests/test_ctypeslib.py", line 8, in <module>
     cdll = load_library('multiarray', np.core.multiarray.__file__)
   File "/home/mb312/tmp/junk/lib/python3.2/site-
 packages/numpy/ctypeslib.py", line 122, in load_library
     raise exc
   File "/home/mb312/tmp/junk/lib/python3.2/site-
 packages/numpy/ctypeslib.py", line 119, in load_library
     return ctypes.cdll[libpath]
   File "/usr/lib/python3.2/ctypes/__init__.py", line 415, in __getitem__
     return getattr(self, name)
   File "/usr/lib/python3.2/ctypes/__init__.py", line 410, in __getattr__
     dll = self._dlltype(name)
   File "/usr/lib/python3.2/ctypes/__init__.py", line 340, in __init__
     self._handle = _dlopen(self._name, mode)
 OSError: /home/mb312/tmp/junk/lib/python3.2/site-
 packages/numpy/core/multiarray.pyd: cannot open shared object file: No
 such file or directory

 This is because the compiled file is now multiarray.cpython-32mu.so not
 multiarray.so or multiarray.pyd as the ctypeslib was previously expecting.
 One fix is to add in ctypeslib around line 100:

             py_exts = [suf for suf, mode, mtype in imp.get_suffixes()
                         if mtype == imp.C_EXTENSION]

 to the extensions to be tested (which will pick up .so along with cpython-
 32mu.so and modulecpython-32mu.so).  This would mean, for non-python
 libraries, the number of exts to search for would increase, presumably not
 very usefully because we don't often use ctypeslib for python extensions,
 I suppose.

Ticket URL: <http://projects.scipy.org/numpy/ticket/1787>
NumPy <http://projects.scipy.org/numpy>
My example project

More information about the NumPy-Tickets mailing list