[Numpy-discussion] fromfile() -- help!

Pauli Virtanen pav+sp@iki...
Fri Jan 8 03:28:33 CST 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