[SciPy-dev] bug in 'frombuffer'

Lisandro Dalcin dalcinl at gmail.com
Mon Jan 9 15:46:31 CST 2006


In latest numpy from SF, file multiarraymodule.c

static char doc_frombuffer[] = \
	"frombuffer(buffer=, dtype=int, count=-1, offset=0)\n"\
/* ... */
static PyObject *
array_frombuffer(PyObject *ignored, PyObject *args, PyObject *keywds)
{
/* ... */
	static char *kwlist[] = {"buffer", "dtype", "count", NULL};
/* ... */
	if (!PyArg_ParseTupleAndKeywords(args, keywds, "O|O&LL",
/* .. */

It seems that 'kwlist' is missing an "offset" entry. This causes an
exception in Python:

>>> a = frombuffer(buff)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: more argument specifiers than keyword list entries



--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594




More information about the Scipy-dev mailing list