[Python-modules-team] Bug#685812: ABI change in 1.6.1 version

Sébastien Villemot sebastien at debian.org
Tue Oct 30 20:21:19 UTC 2012

I found the cause of this bug: in
numpy/core/include/numpy/ndarraytypes.h, in the enum NPY_TYPES, the
value NPY_CHAR has changed between NumPy 1.5 and 1.6 (more precisely, it
was increased by 3, because new types were introduced).

python-scientific uses this enum value at several places (under its
alias PyArray_CHAR). Hence the bug. I verified that replacing
PyArray_CHAR by (PyArray_CHAR+3) in python-scientific and then compiling
against NumPy 1.5 creates a package which is ABI compatible with NumPy

This is clearly an ABI breakage in NumPy. I don't see how to fix it
without bumping the ABI number. Since NPY_CHAR must apparently come
after NPY_NTYPES in the enum (the latter counts the number of types), it
seems difficult to patch NumPy 1.6 so that NPY_CHAR keeps the same value
as in 1.5.

What remains unclear to me is whether NPY_CHAR is really meant to be
part of the external API. It looks like the NumPy maintainers are
well-aware of ABI compatibility issues in this very enum (see the
comments in the 1.6 source file), so maybe the change is on purpose. In
that latter case, it is python-scientific which is buggy. That remains
to be clarified.

 .''`.    Sébastien Villemot
: :' :    Debian Developer
`. `'     http://www.dynare.org/sebastien
  `-      GPG Key: 4096R/381A7594
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20121030/98072e89/attachment.pgp>

More information about the Python-modules-team mailing list