foedus_code
foedus_code copied to clipboard
fix hang in subprocess.Popen / subprocess.wait()
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