Misunderstanding buffering - flushing isn't

Dave Angel davea at davea.name
Thu Nov 6 05:11:47 CET 2014

Skip Montanaro <skip.montanaro at gmail.com> Wrote in message:
> On Wed, Nov 5, 2014 at 10:44 AM, Skip Montanaro
> <skip.montanaro at gmail.com> wrote:
>> I figured everything would be flushed to the respective .stdout and
>> .stderr files at the end of every request, but that appears not to be
>> the case.
> I stand corrected. I added
>         print ">> request finished"
> to the end of do_GET (just before the flush() calls). I see that in
> the output files after the request finishes. Maybe I was just
> dreaming...
> S

Wild guess here. I've worked in environments where a newline would
 trigger a flush.  To check that,  try a trailing comma on the
 last print, which suppresses the newline.

More information about the Python-list mailing list