This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scott.dial
Recipients belopolsky, gpolo, josm, loewis, scott.dial
Date 2008-12-23.17:13:22
SpamBayes Score 4.6079258e-05
Marked as misclassified No
Message-id <1230052403.71.0.543013176831.issue1706039@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-12-23 17:13:23scott.dialsetrecipients: + scott.dial, loewis, belopolsky, josm, gpolo
2008-12-23 17:13:23scott.dialsetmessageid: <1230052403.71.0.543013176831.issue1706039@psf.upfronthosting.co.za>
2008-12-23 17:13:22scott.diallinkissue1706039 messages
2008-12-23 17:13:22scott.dialcreate