From 6ad492cf575b38dffe4283e3314499b7518055fe Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Tue, 8 Apr 2014 17:12:02 +1000 Subject: Stop trying to close the open process execute_to_log tries to be good and clean up the open file descriptors. However it would also try and close the subprocess which cleans itself up. Avoid "IOError: [Errno 9] Bad file descriptor" by skipping over the subprocess file descriptor. Change-Id: Iae7d21bbacd07f487fb56592ea12cbd4edb06ca4 --- turbo_hipster/lib/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/turbo_hipster/lib/utils.py b/turbo_hipster/lib/utils.py index fa295af..f0603af 100644 --- a/turbo_hipster/lib/utils.py +++ b/turbo_hipster/lib/utils.py @@ -186,6 +186,9 @@ def execute_to_log(cmd, logfile, timeout=-1, # Clean up for fd, descriptor in descriptors.items(): poll_obj.unregister(fd) + if fd == p.stdout.fileno(): + # Don't try and close the process, it'll clean itself up + continue os.close(fd) try: p.kill() -- cgit v1.2.1