Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upsubprocess._loop deleted too soon causing exception when trying to read from pipe #484
Comments
|
Could this be solved by checking that When I add that it doesn't complain about |
|
That'd fix the exception but if something is left in the pipe then that is gone... |
|
That's true, I'll look for a better fix with subprocess. |
|
So I turned EDIT: So I've got a patch for this that I'll submit as a PR later tonight. Basically have to wait for all pipes to be closed/lost before finally closing the |
|
Submitted a PR #485 to fix this issue. Will work more on it tonight. |
From https://bugs.python.org/issue23242#msg284930
The following script is used to reproduce the bug:
will produce following output and terminate with exception:
When the process exits https://github.com/python/asyncio/blob/master/asyncio/unix_events.py#L444 is called which sets this._loop = None
Next time read() is called on the pipe the above exception is thrown.
I have tried to fix this issue myself but would sometimes have read terminate too early and miss the last chunks of data.