Jeremy Kloth added the comment:

It seems to me that it is a quite simple fix:

--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -1110,7 +1110,7 @@ file_read(PyFileObject *f, PyObject *args)
-            clearerr(f->f_fp);
+            if (ferror(f->f_fp)) clearerr(f->f_fp);

which is exactly what the empty read case does above this.

This fixes my error, and produces no changes to the test suite.

I guess it could be wrapped in an #ifdef MS_WINDOWS, just it case, but that 
seems unnecessary as the previous code does not.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30460>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to