[Numpy-discussion] New SVN (>1939) requires a rebuild of extension modules

Sasha ndarray at mac.com
Wed Jan 18 21:04:01 EST 2006


+1

I suggest a little more descriptive exception:

PyErr_Format(PyExc_ImportError,
                     "extension module compiled against version %X of numpy API"
                     ", not %X", NDARRAY_VERSION, PyArray_GetNDArrayCVersion())

On 1/18/06, Andrew Straw <strawman at astraw.com> wrote:
> Travis Oliphant wrote:
>
> >
> > Just in case you missed the note in the middle of another message.
> >
> > The SVN version of NumPy has a few new C-API calls and requires a
> > rebuild of extension modules.  If you get mysterious segfaults all of
> > a sudden, you haven't recompiled...
> >
> > -Travis
> >
>
> Hi Travis,
>
> I have an idea that might prevent people from accidentally getting
> mysterious errors due to mixing extensions compiled against different
> versions of numpy. Basically, the idea is that a version number is
> changed every time the C API changes. This version number is stored in
> each extension module at compile time, and at run time, each module init
> function that calls import_array() will trigger a test against the
> version number of the numpy core.
>
> I've implemented my idea in the included patch, and, as far as I can
> tell, it actually works. This is based on using the NDARRAY_VERSION
> define in arrayobject.h, which I'm completely unsure if this is a
> suitable use for. Furthermore, there's a lot going on that I don't
> understand in this part of the numpy code. Thus, I consider my patch
> only a proof of concept and hope you (or someone) will take this idea,
> perhaps the patch, and run with it. I hope this prevents many headaches
> in the future...
>
> What do you think?
>
>
>




More information about the NumPy-Discussion mailing list