Message32319
It appears your "yes" does not catch SIGPIPE. I've reproduced the issue with
$ python -c 'import sys, os; sys.stdout.write(os.popen("while :; do echo yes ; done | echo hello").read())'
Traceback (most recent call last):
File "<string>", line 1, in <module>
KeyboardInterrupt
The documentation on Python module signal says SIGPIPE is ignored by Python as well. My work-around to this was to catch SIGPIPE, but the GNU C library would terminate the whole script.
$ python -c 'import sys, os, signal; signal.signal(signal.SIGPIPE, signal.SIG_DFL); sys.stdout.write(os.popen("while :; do echo yes ; done | echo hello").read())'
hello
http://www.gnu.org/software/libc/manual/html_node/Operation-Error-Signals.html
Perhaps, writing own signal handler might help.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:54:59 | admin | link | issue1736483 messages |
2007-08-23 14:54:59 | admin | create | |
|