<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,  &lt;<a href="mailto:skip@pobox.com">skip@pobox.com</a>&gt; 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>
 &nbsp; &nbsp;test test_signal failed -- Traceback (most recent call last):<br>
 &nbsp; &nbsp; &nbsp;File &quot;/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_signal.py&quot;, line 151, in test_main<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.fail(tb)<br>
 &nbsp; &nbsp;AssertionError: Traceback (most recent call last):<br>
 &nbsp; &nbsp; &nbsp;File &quot;/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_signal.py&quot;, line 134, in test_main<br>
 &nbsp; &nbsp; &nbsp; &nbsp;self.run_test()<br>
 &nbsp; &nbsp; &nbsp;File &quot;/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/test_signal.py&quot;, line 80, in run_test<br>
 &nbsp; &nbsp; &nbsp; &nbsp;child = subprocess.Popen([&#39;kill&#39;, &#39;-HUP&#39;, str(pid)])<br>
 &nbsp; &nbsp; &nbsp;File &quot;/Users/buildslave/bb/trunk.psf-g4/build/Lib/subprocess.py&quot;, line 593, in __init__<br>
 &nbsp; &nbsp; &nbsp; &nbsp;errread, errwrite)<br>
 &nbsp; &nbsp; &nbsp;File &quot;/Users/buildslave/bb/trunk.psf-g4/build/Lib/subprocess.py&quot;, line 1078, in _execute_child<br>
 &nbsp; &nbsp; &nbsp; &nbsp;data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB<br>
 &nbsp; &nbsp;OSError: [Errno 4] Interrupted system call<br>
<br>
This is the code which reads stderr from the child process:<br>
<br>
 &nbsp; &nbsp;data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB<br>
 &nbsp; &nbsp;os.close(errpipe_read)<br>
 &nbsp; &nbsp;if data != &quot;&quot;:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;os.waitpid(self.pid, 0)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;child_exception = pickle.loads(data)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;raise child_exception<br>
<br>
I&#39;m not an expert in this stuff my any stretch of the imagination, but<br>
shouldn&#39;t subprocess try harder to read this output? &nbsp;Something like:<br>
<br>
 &nbsp; &nbsp;while True:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;try:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB<br>
 &nbsp; &nbsp; &nbsp; &nbsp;except OSError, err:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if err.errno == errno.EINTR:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;raise<br>
 &nbsp; &nbsp; &nbsp; &nbsp;else:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;os.close(errpipe_read)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if data != &quot;&quot;:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;os.waitpid(self.pid, 0)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;child_exception = pickle.loads(data)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;raise child_exception<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break<br>
<br>
Maybe not while True, but try a few times at least.&nbsp;<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?&nbsp;<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>