cpython: 2a0bda8d283d (original) (raw)

Mercurial > cpython

changeset 86557:2a0bda8d283d

Switch subprocess stdin to a socketpair, attempting to fix issue #19293 (AIX hang). [#19293]

Guido van Rossum guido@dropbox.com
date Mon, 21 Oct 2013 20:37:14 -0700
parents df2b2b1f1289
children b9019b942435
files Lib/asyncio/unix_events.py Lib/test/test_asyncio/test_unix_events.py
diffstat 2 files changed, 32 insertions(+), 4 deletions(-)[+] [-] Lib/asyncio/unix_events.py 29 Lib/test/test_asyncio/test_unix_events.py 7

line wrap: on

line diff

--- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -213,6 +213,9 @@ class _UnixReadPipeTransport(transports. self._loop = loop self._pipe = pipe self._fileno = pipe.fileno()

@@ -275,21 +278,29 @@ class _UnixWritePipeTransport(transports self._loop = loop self._pipe = pipe self._fileno = pipe.fileno()

+

self._loop.call_soon(self._protocol.connection_made, self) if waiter is not None: self._loop.call_soon(waiter.set_result, None) def _read_ready(self):

def write(self, data): @@ -435,8 +446,15 @@ class _UnixSubprocessTransport(transport self._loop = loop self._pipes = {}

@@ -448,6 +466,9 @@ class _UnixSubprocessTransport(transport self._proc = subprocess.Popen( args, shell=shell, stdin=stdin, stdout=stdout, stderr=stderr, universal_newlines=False, bufsize=bufsize, **kwargs)

def close(self):

--- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -312,6 +312,13 @@ class UnixReadPipeTransportTests(unittes fcntl_patcher.start() self.addCleanup(fcntl_patcher.stop)

+ def test_ctor(self): tr = unix_events._UnixReadPipeTransport( self.loop, self.pipe, self.protocol)