[Numpy-discussion] fromfile() -- help!
Pauli Virtanen
pav+sp at iki.fi
Fri Jan 8 04:28:33 EST 2010
Thu, 07 Jan 2010 17:21:34 -0800, Christopher Barker wrote:
[clip]
> It does pass on that return value, but, from ctors.c:
>
> fromfile_next_element(FILE **fp, void *dptr, PyArray_Descr *dtype,
> void *NPY_UNUSED(stream_data))
> {
> /* the NULL argument is for backwards-compatibility */ return
> dtype->f->scanfunc(*fp, dptr, NULL, dtype);
> }
This functions is IMHO where the fix should go; I believe it should do
something like
return (ret == 0 || ret == EOF) ? -1 : ret;
--
Pauli Virtanen
More information about the NumPy-Discussion
mailing list