Ralf Schmitt added the comment:
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
[EMAIL PROTECTED] ok
Hello
Hello
Traceback (most recent call last):
File "t.py", line 5, in <module>
print "Hello"
IOError: [Errno 32] Broken pipe
----------
nosy: +schmir
_____________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1488934>
_____________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com