Message78243
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. |
|
Date |
User |
Action |
Args |
2008-12-23 17:13:23 | scott.dial | set | recipients:
+ scott.dial, loewis, belopolsky, josm, gpolo |
2008-12-23 17:13:23 | scott.dial | set | messageid: <1230052403.71.0.543013176831.issue1706039@psf.upfronthosting.co.za> |
2008-12-23 17:13:22 | scott.dial | link | issue1706039 messages |
2008-12-23 17:13:22 | scott.dial | create | |
|