[Python-Dev] test_signal on osx g4 (original) (raw)

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:

testsignal is failing on osx g4:

test testsignal failed -- Traceback (most recent call last): File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/testsignal.py", line 151, in testmain self.fail(tb) AssertionError: Traceback (most recent call last): File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/testsignal.py", line 134, in testmain self.runtest() File "/Users/buildslave/bb/trunk.psf-g4/build/Lib/test/testsignal.py", line 80, in runtest 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 executechild data = os.read(errpiperead, 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(errpiperead, 1048576) # Exceptions limited to 1 MB os.close(errpiperead) if data != "": os.waitpid(self.pid, 0) childexception = pickle.loads(data) raise childexception 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(errpiperead, 1048576) # Exceptions limited to 1 MB except OSError, err: if err.errno == errno.EINTR: continue else: raise else: os.close(errpiperead) if data != "": os.waitpid(self.pid, 0) childexception = pickle.loads(data) raise childexception 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