[Python-Dev] [issue2263] struct.pack() + numpy int raises SystemError (original) (raw)

grubert at users.sourceforge.net grubert at users.sourceforge.net
Thu Feb 12 18:32:11 CET 2009


hello,

i took a look at unassigned open issue with the oldest activity this happened to be issue2263

Original bug report:

struct.pack() raises SystemError when fed a numpy integer in some cases. The following was run on MacOSX 10.4, little endian (I can only reproduce the error if I specify big endian for the struct format). Not sure if this could be a numpy bug.

i checked on ubuntu 8.04, Python 2.7a0 (trunk:69044) and numpy 1.2.1 and found

digging into the source, for pack "B", ">B" and "<B", in _struct.c

Including Py_TPFLAGS_INT_SUBCLASS in numpy's BASEFLAGS cures this. (for positive values, packing negative numpy scalars needs a closer look)

This seams to be an external problem then.

But I could not find any reference to Py_TPFLAGS_*_SUBCLASS in the documentation, that is a python problem.

hope this is of any use.

cheers engelbert



More information about the Python-Dev mailing list