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 rosslagerwall
Recipients dmalcolm, giampaolo.rodola, gregory.p.smith, pitrou, rosslagerwall, simon3z
Date 2011-03-31.12:35:18
SpamBayes Score 2.2324811e-07
Marked as misclassified No
Message-id <1301574920.0.0.273053702406.issue10963@psf.upfronthosting.co.za>
In-reply-to
Content
I'd argue that this is not a feature request but a bug.

I did some testing of this issue and the problem is that EPIPE is only generated sometimes depending on the time the process takes to finish, the size of the data sent, the underlying mechanism used (select vs poll) and the whether anything happens between the starting of the process and the communicate() call.

Here are some results (on my PC, I think some of these will vary on others):
With poll:
 [sys.executable, 'c', 'pass']- no error
 ['dd', 'option=bad'] - varies between EPIPE and no error
 ['dd', 'option=bad'], sleep(1) - EPIPE

With select:
 [sys.executable, 'c', 'pass']- EPIPE
 ['dd', 'option=bad'] - EPIPE
 ['dd', 'option=bad'], sleep(1) - EPIPE

Only stdin (neither select or poll):
 [sys.executable, 'c', 'pass']- no error (error in 2.7)
 ['dd', 'option=bad'] - no error (error in 2.7)
 ['dd', 'option=bad'], sleep(1) - EPIPE

(all of my tests appear to fail on Windows, they also generate EINVAL sometimes)

I think it's best to remove all this inconsistency and fix it so that EPIPE is never generated and then backport it to 2.7, 3.1, 3.2.

Attached is a patch which fixes it for poll, select, windows and adds two tests.
History
Date User Action Args
2011-03-31 12:35:20rosslagerwallsetrecipients: + rosslagerwall, gregory.p.smith, pitrou, giampaolo.rodola, dmalcolm, simon3z
2011-03-31 12:35:19rosslagerwallsetmessageid: <1301574920.0.0.273053702406.issue10963@psf.upfronthosting.co.za>
2011-03-31 12:35:19rosslagerwalllinkissue10963 messages
2011-03-31 12:35:19rosslagerwallcreate