Scott Dial <sc...@scottdial.com> added the comment: They differ because in Py_UniversalNewlineFgets() there is a call to FLOCKFILE(), and it seemed appropriate to ensure that clearerr() was called after locking the FILE stream. I certainly pondered over whether it made a difference to do it before or after, and it would seem to me that if we are bothering to lock the FILE stream then we would care to ensure that the first GETC() after locking reaps the benefit of having called clearerr(). In the cases that we fall into fread and fgets, we may actually need to be doing:
FLOCKFILE(stream) clearerr(stream); result = fgets(buf, n, stream); FUNLOCKFILE(stream); return result; One nitpick is that the testcase was appended to the StdoutTests class instead of OtherFileTests class, which would seem more appropriate. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1706039> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com