I am trying to use winpexpect to have an interactive subprocesses in Python. I am completely baffled. When I run a unit test, winspawn executes normally along with all the expects. When I run my program as a whole, winspawn inexplicably blocks forever. How can this be? As far as I know, winspawn is non-blocking.

有帮助吗?

解决方案

So, I found out that the string I was passing to winpexpect was Unicode in one case and str in another case. It seems that winpexpect will block at winspawn if the string you pass in is unicode.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top