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 schmir
Recipients akuchling, edemaine, schmir
Date 2008-01-09.22:29:06
SpamBayes Score 0.027535545
Marked as misclassified No
Message-id <1199917761.71.0.260420057352.issue1488934@psf.upfronthosting.co.za>
In-reply-to
Content
the c program is broken as it does not check the error code of fflush.
The real problem is buffering.

while True:
__print 'Hello'
__time.sleep (1)

will not notice an error until the buffers are flushed.
Running python t.py |head -n2 and killing head does not give me an
error. with PYTHONUNBUFFERED=1 or when using sys.stdout.flush() the
program breaks with:

~/ PYTHONUNBUFFERED=1 python t.py|head -n2                       
ralf@rat64 ok
Hello
Hello
Traceback (most recent call last):
  File "t.py", line 5, in <module>
    print "Hello"
IOError: [Errno 32] Broken pipe
History
Date User Action Args
2008-01-09 22:29:21schmirsetspambayes_score: 0.0275355 -> 0.027535545
recipients: + schmir, akuchling, edemaine
2008-01-09 22:29:21schmirsetspambayes_score: 0.0275355 -> 0.0275355
messageid: <1199917761.71.0.260420057352.issue1488934@psf.upfronthosting.co.za>
2008-01-09 22:29:07schmirlinkissue1488934 messages
2008-01-09 22:29:06schmircreate