From: Guido van Rossum Date: Thu, 19 Feb 1998 20:46:48 +0000 (+0000) Subject: Check ferror(), not errno, for fread() error. X-Git-Tag: v1.5.1~656 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3da3fcef961c4be22806d9d94df5f1d0f09dbbc7;p=python Check ferror(), not errno, for fread() error. --- diff --git a/Objects/fileobject.c b/Objects/fileobject.c index cd8a730954..5502f156ff 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -695,7 +695,7 @@ file_readlines(f, args) Py_END_ALLOW_THREADS if (nread == 0) { sizehint = 0; - if (nread == 0) + if (!ferror(f->f_fp)) break; PyErr_SetFromErrno(PyExc_IOError); clearerr(f->f_fp);