@@ -, +, @@ --- pym/portage/util/_async/PipeLogger.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/pym/portage/util/_async/PipeLogger.py +++ a/pym/portage/util/_async/PipeLogger.py @@ -98,9 +98,8 @@ class PipeLogger(AbstractPollTask): stdout_buf = \ stdout_buf[os.write(stdout_fd, stdout_buf):] except OSError as e: - if e.errno != errno.EAGAIN: + if e.errno not in (errno.EAGAIN, errno.EIO): raise - del e failures += 1 if failures > 50: # Avoid a potentially infinite loop. In @@ -108,6 +107,12 @@ class PipeLogger(AbstractPollTask): # and it's unlikely to exceed 1. raise + if e.errno != errno.EAGAIN: + # For cases like bug #459674 where we receive + # an unexpected EIO error on Linux, simply + # retry until our failure limit is reached. + continue + # This means that a subprocess has put an inherited # stdio file descriptor (typically stdin) into # O_NONBLOCK mode. This is not acceptable (see bug --