Vitaly added the comment: Per Charles-François Natali (neologix), I tried the following:
1. Reduce the initial read size argument (rSize in my code snippet) from 1048576 (1MB, the same amount as used by subprocess.Popen._executeChild) to 1000000: the problem appears to go away (could be just red herring, though); this actually makes me think that it's a Python implementation problem on MacOS - why should an initial read request with 1048576 read size trigger EINVAL every other time (1,3,5,9, etc.), but using the initial size of 1000000 doesn't? 2. "put a short sleep before exiting the child process (after pickling the exception) to see what happens if the reader reads before the pipe is closed by the other end" -- I took that to mean a delay after the "os.write(errpipe_write, pickle.dumps(exc_value))" call in my snippet: I tried 1, 2, and 4-second delays (via time.sleep()). One time, I saw the Invalid Argument in only one of the 9 iterations, but in all the other runs Invalid Argument showed up as before on iterations: 1, 3, 5, 7, 9 3. put the delay (tried with 1 and 2 seconds) before "os.write(errpipe_write, pickle.dumps(exc_value))": Invalid Argument showed up as before on iterations: 1, 3, 5, 7, 9 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15896> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com