<br>this is <a href="http://bugs.python.org/issue1068268">http://bugs.python.org/issue1068268</a><br><br><div class="gmail_quote">On Tue, Apr 1, 2008 at 5:05 PM, <<a href="mailto:skip@pobox.com">skip@pobox.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">test_signal is failing on osx g4:<br>
<br>
test test_signal failed -- Traceback (most recent call last):<br>
File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_signal.py", line 151, in test_main<br>
self.fail(tb)<br>
AssertionError: Traceback (most recent call last):<br>
File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_signal.py", line 134, in test_main<br>
self.run_test()<br>
File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_signal.py", line 80, in run_test<br>
child = subprocess.Popen(['kill', '-HUP', str(pid)])<br>
File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/subprocess.py", line 593, in __init__<br>
errread, errwrite)<br>
File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/subprocess.py", line 1078, in _execute_child<br>
data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB<br>
OSError: [Errno 4] Interrupted system call<br>
<br>
This is the code which reads stderr from the child process:<br>
<br>
data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB<br>
os.close(errpipe_read)<br>
if data != "":<br>
os.waitpid(self.pid, 0)<br>
child_exception = pickle.loads(data)<br>
raise child_exception<br>
<br>
I'm not an expert in this stuff my any stretch of the imagination, but<br>
shouldn't subprocess try harder to read this output? Something like:<br>
<br>
while True:<br>
try:<br>
data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB<br>
except OSError, err:<br>
if err.errno == errno.EINTR:<br>
continue<br>
else:<br>
raise<br>
else:<br>
os.close(errpipe_read)<br>
if data != "":<br>
os.waitpid(self.pid, 0)<br>
child_exception = pickle.loads(data)<br>
raise child_exception<br>
break<br>
<br>
Maybe not while True, but try a few times at least. <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Or is the system supposed to automatically restart interrupted system calls? <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Skip<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/schmir%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-dev/schmir%40gmail.com</a><br>
</blockquote></div><br>