[Numpy-discussion] PEP 3118 array size check

Pauli Virtanen pav@iki...
Wed Aug 10 03:01:59 CDT 2011


Mon, 08 Aug 2011 11:27:14 -0400, Angus McMorland wrote:
> I've just upgraded to the latest numpy from git along with upgrading
> Ubuntu to natty. Now some of my code, which relies on ctypes-wrapping of
> data structures from a messaging system, fails with the error message:
> 
> "RuntimeWarning: Item size computed from the PEP 3118 buffer format
> string does not match the actual item size."
> 
> Can anyone tell me if this was a change that has been added into the git
> version recently, in which case I can checkout a previous version of
> numpy, or if I've got to try downgrading the whole system (ergh.)

Python's ctypes module implements its PEP 3118 support incorrectly
in recent Python versions. There's a patch in waiting:

	http://bugs.python.org/issue10744

In the meantime, you can just silence the warnings using the warnings
module,

	warnings.simplefilter("ignore", RuntimeWarning)

-- 
Pauli Virtanen



More information about the NumPy-Discussion mailing list