[Python-Dev] test_signal on osx g4

Jeffrey Yasskin jyasskin at gmail.com
Wed Apr 2 06:10:22 CEST 2008


I've tried to fix test_signal at least. For those particular calls,
EINTR means that the kill I launched finished before I was expecting,
so we can ignore it without retrying. Figuring out subprocess in
general is a worthy goal but shouldn't block making the test less
flaky. :) r62102.

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



-- 
Namasté,
Jeffrey Yasskin
http://jeffrey.yasskin.info/


More information about the Python-Dev mailing list