[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread STINNER Victor
STINNER Victor added the comment: > However, I submit to you that this is NOT an eventlet issue. (...) capture > all exceptions that would point a user to retry (such as EAGAIN and EINTR) > and mask them and return some EFATAL. You cannot get EAGAIN on a blocking file descriptor and subprocess

[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread Amrith Kumar
Amrith Kumar added the comment: I see three comments, one from r.david.murray, one from haypo and one from pitrou. I'll try and address all three. r.david.murray: The code in question is in https://github.com/openstack/oslo-incubator/blob/master/openstack/common/processutils.py#L177-L189 not

[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread STINNER Victor
STINNER Victor added the comment: Instead of just catching EAGAIN, you can catch BlockingIOError. In Python 2.7, it means catching: (EAGAIN, EALREADY, EINPROGRESS, EWOULDBLOCK) errors. I made a similar change in asyncore recently: --- changeset: 91833:d422062d7d36 branch: 2.7 parent:

[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: This sounds like an issue specific to eventlet. There's no reason for the standard communicate() call to raise EAGAIN, since the created pipes are blocking. That said, if the fix is that trivial, I wouldn't be opposed to see it enter the stdlib (assuming it d

[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread R. David Murray
R. David Murray added the comment: I believe our recent thinking in recent times has been to handle EAGAIN in the higher level interfaces such as subprocess, not expose them to the caller. Does python3 have the same problem? I isn't clear that you have provided enough information to reproduce

[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread Amrith Kumar
Amrith Kumar added the comment: I'll supply a patch for this proposed change. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue22114] You cannot call communicate() safely after receiving EAGAIN

2014-07-31 Thread Amrith Kumar
New submission from Amrith Kumar: Environment: - Linux (Ubuntu 14.04 LTS, x64) running Python 2.7. - Code uses eventlet.green.subprocess Code establishes subprocess as: subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE,