[pypy-dev] error from function.py

Armin Rigo arigo at tunes.org
Thu Dec 16 16:07:35 CET 2010


On Thu, Dec 16, 2010 at 1:35 PM, Arnd Rechenburg
<Arnd.Rechenburg at tomtom.com> wrote:
>     return cdll.ptr(self.name, argshapes, resshape, self._flags_)
> AttributeError: 'NoneType' object has no attribute 'ptr'

That's a very indirect way of crashing because
ctypes.util.find_library('c') returned None, i.e. it did not find your
C library.  I agree that this could be improved by at least reporting
a clearer error.

To understand the error, first note that it occurs in standard code
from CPython's "ctypes.util" module.  Look in
lib-python/modified-2.5.2/ctypes/util.py.  On Linux it seems to call
"/sbin/ldconfig -p" and look in the result for "/libc.*".  On my
machine it would first find "/lib/libc.so.6" in this way, which is
correct.  In general it all looks pretty hackish, but it's not clear
if any particular piece of code is to blame, given the way that the
system of libraries is designed, which is not really adapted for fully
dynamic lookups like needed here...

A bientôt,


More information about the Pypy-dev mailing list