classification
Title: subprocess: Popen.communicate() doesn't handle EINTR in some cases
Type: Stage:
Components: Library (Lib) Versions: Python 3.3, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: haypo, neologix, python-dev
Priority: normal Keywords: patch

Created on 2011-07-04 22:03 by haypo, last changed 2011-07-06 08:50 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
subprocess_communicate_eintr.patch haypo, 2011-07-04 22:03 review
Messages (5)
msg139811 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-07-04 22:03
subprocess.Popen.communicate() doesn't catch EINTR error if it is called without timeout and if there is only one PIPE (stdout or stderr).

Attached patch fixes these cases. It may need a test.

I found this bug while working on test_signal, especially on the inter process signal tests.
msg139860 - (view) Author: Roundup Robot (python-dev) Date: 2011-07-05 12:08
New changeset dcfacc2d93b4 by Victor Stinner in branch '3.2':
Issue #12493: subprocess: communicate() handles EINTR
http://hg.python.org/cpython/rev/dcfacc2d93b4

New changeset 42e23db3ddfc by Victor Stinner in branch 'default':
(merge 3.2) Issue #12493: subprocess: communicate() handles EINTR
http://hg.python.org/cpython/rev/42e23db3ddfc

New changeset 6a28ccde2f1b by Victor Stinner in branch '2.7':
Issue #12493: subprocess: communicate() handles EINTR
http://hg.python.org/cpython/rev/6a28ccde2f1b
msg139867 - (view) Author: Roundup Robot (python-dev) Date: 2011-07-05 12:51
New changeset 807921ba241d by Victor Stinner in branch '3.2':
Issue #12493: skip test_communicate_eintr() if signal.SIGALRM is missing
http://hg.python.org/cpython/rev/807921ba241d

New changeset 4928cf093a11 by Victor Stinner in branch 'default':
(merge 3.2) Issue #12493: skip test_communicate_eintr() if signal.SIGALRM is missing
http://hg.python.org/cpython/rev/4928cf093a11

New changeset 8a4c9c154b5d by Victor Stinner in branch '2.7':
Issue #12493: skip test_communicate_eintr() if signal.SIGALRM is missing
http://hg.python.org/cpython/rev/8a4c9c154b5d
msg139925 - (view) Author: Charles-Fran├žois Natali (neologix) * (Python committer) Date: 2011-07-06 06:58
Out of curiosity, how could SIGALRM be missing on a Unix system?
Maybe you mean something like
@unittest.skipUnless(hasattr(errno, EINTR),
                     "Requires errno.EINTR")
msg139928 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-07-06 08:50
> Out of curiosity, how could SIGALRM be missing on a Unix system?

It is only missing on Windows.
History
Date User Action Args
2011-07-06 08:50:41hayposetmessages: + msg139928
2011-07-06 06:58:17neologixsetnosy: + neologix
messages: + msg139925
2011-07-05 12:51:04python-devsetmessages: + msg139867
2011-07-05 12:09:30hayposetstatus: open -> closed
resolution: fixed
2011-07-05 12:08:18python-devsetnosy: + python-dev
messages: + msg139860
2011-07-04 22:03:09haypocreate