This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vitaly
Recipients vitaly
Date 2012-09-09.23:04:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347231879.4.0.256223701777.issue15896@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2.6.7 on Mac OS 10.7.4 running on MacBookPro laptop.


run attachment as: python test_pipe_error.py

The test() function makes multiple calls to _execute_child() in a loop. Every other call to _execute_child() fails with:
=====
os.read(3, 1048576) self pid:  43953
EINVAL FROM TEST:  Traceback (most recent call last):
  File "test_pipe_error.py", line 127, in test
    _execute_child()
  File "test_pipe_error.py", line 95, in _execute_child
    newData = os.read(errpipe_read, rSize)
OSError: [Errno 22] Invalid argument
=====

_execute_child() is based on subprocess.Popen._execute_child, but with most Popen code removed and errpipe_read configured as os.O_NONBLOCK in the parent process.  Raising of an Exception() instance is used to simulate failure in os.execvp() instead of calling os.execvp().

We initially experienced the EINVAL issue in the parent process' os.read call when os.execvp failed in the child (e.g., errno=2, "file not found"), so I stripped the code to bare minimum in order to reproduce the problem with a smaller code snippet.
History
Date User Action Args
2012-09-09 23:04:39vitalysetrecipients: + vitaly
2012-09-09 23:04:39vitalysetmessageid: <1347231879.4.0.256223701777.issue15896@psf.upfronthosting.co.za>
2012-09-09 23:04:38vitalylinkissue15896 messages
2012-09-09 23:04:38vitalycreate