Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It happens from time to time that subprocess close() stalls forever. I guess the reason is a raise conditions when terminating the process and closing the piped streams. A note in Python's subprocess documentation[1] suggests to use following code snipped to properly terminate/kill a subprocess: proc = subprocess.Popen(...) try: outs, errs = proc.communicate(timeout=15) except TimeoutExpired: proc.kill() outs, errs = proc.communicate() Reference: [1]: https://docs.python.org/3/library/subprocess.html
- Loading branch information