Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for invoke silently failing on Windows (pyinvoke#683).
There is a race condition between process_is_finished and has_dead_threads, at least on windows. The check for the process being finished returns False, then the stdio and stderr threads "die", so the process exists without a valid error code. Return code is None, then all the tasks abort without any error messages, even though the processes have completed successfully. This happens so frequently that it makes invoke almost entirely unusable on Windows. This workaround is not a great solution, by all accounts. If it detects that there are dead threads, but the process is not finished, it simply continues polling for another 3 seconds to wait for the process to complete gracefully. As I don't know the code that well, I'm willing to bet there's a better solution to this problem than just polling for an arbitrary amount of time. However, I've been using it all morning, in two different projects, and it seems to be working fine.
- Loading branch information