Skip to content

Commit a0a38c1

Browse files
committed
bpo-46364: only use socket for stdin on AIX
Signed-off-by: Christoph Hamsen <[email protected]>
1 parent 7c770d3 commit a0a38c1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/asyncio/unix_events.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -788,12 +788,11 @@ class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport):
788788

789789
def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
790790
stdin_w = None
791-
if stdin == subprocess.PIPE:
792-
# Use a socket pair for stdin, since not all platforms
791+
if stdin == subprocess.PIPE and sys.platform.startswith('aix'):
792+
# Use a socket pair for stdin on AIX, since it does not
793793
# support selecting read events on the write end of a
794794
# socket (which we use in order to detect closing of the
795-
# other end). Notably this is needed on AIX, and works
796-
# just fine on other platforms.
795+
# other end).
797796
stdin, stdin_w = socket.socketpair()
798797
try:
799798
self._proc = subprocess.Popen(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restrict use of sockets instead of pipes for stdin of subprocesses created by :mod:`asyncio` to AIX platform only.

0 commit comments

Comments
 (0)