From 5a790239be6d70f65447c0a0e69d593fe2fa2305 Mon Sep 17 00:00:00 2001 From: Jon Thacker Date: Thu, 27 Dec 2018 10:20:11 -0800 Subject: [PATCH] Fix endless while loop on EOF for pty process os.read spec says that when EOF is reached by the fd, an empty bytes object is returned. --- src/execution/process_pty.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/execution/process_pty.py b/src/execution/process_pty.py index 48d1415a..43de6ec7 100644 --- a/src/execution/process_pty.py +++ b/src/execution/process_pty.py @@ -72,6 +72,8 @@ def pipe_process_output(self): while True: try: chunk = os.read(self.pty_master, max_read_bytes) + if not chunk: + break data += chunk except BlockingIOError: