foedus_code icon indicating copy to clipboard operation
foedus_code copied to clipboard

fix hang in subprocess.Popen / subprocess.wait()

Open fishpepper opened this issue 8 years ago • 0 comments

I experienced hangs when running the wrapper on projects with huge stylecheck errors. The python doc (https://docs.python.org/2/library/subprocess.html#subprocess.Popen) has the following snippet concerning calling wait() on the subprocess object:

Warning This will deadlock when using stdout=PIPE and/or stderr=PIPE and the child process generates enough output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use communicate() to avoid that.

My patch fixes this deadlock by using a temporary file object for storage/data passing  

fishpepper avatar Dec 20 '16 15:12 fishpepper