Open harvimt opened 9 years ago
I also have these errors, in my app and in my tests, when closing the event loop :
ERROR:quamash.QEventLoop:Cancelling an overlapped future failed
future: <_OverlappedFuture pending overlapped=<pending, 0x42bde50> cb=[BaseProactorEventLoop._loop_self_reading()]>
Traceback (most recent call last):
File "D:\Anaconda3_64\lib\asyncio\windows_events.py", line 62, in _cancel_overlapped
self._ov.cancel()
OSError: [WinError 6] The handle is invalid
Debugging with pycharm, here is what I found. The line https://github.com/python/asyncio/blob/master/asyncio/proactor_events.py#L455 is called the the future named "_self_reading_future" is canceled and set to None. It's descriptor address is for example "133875888".
But then, in https://github.com/python/asyncio/blob/7baef9de28bd0a8e5bb14ad962059dced9f23bb3/asyncio/windows_events.py#L718, there remains for some reason a future calling as a callback "QEventLoop._loop_self_reading" in the cache, and is pending. This future is then canceled. It's descriptor is different from the previous one ( adress : 133875744 ) but an error is present on this one : 997. If I follow microsoft doc ( https://msdn.microsoft.com/en-us/library/windows/desktop/ms681388%28v=vs.85%29.aspx ), 997 means : ERROR_IO_PENDING, Overlapped I/O operation is in progress.
This pull request was doing a regression. The logs in this issue are not present, but with my patch they come back.
The PyQt4 and PyQt5 tests on appveyor are passing, but I get this:
may be related to #34
PySide tests give off a similar error, in addition to:
but fail, however, the PySide tests have been failing for awhile for no reason on windows (like the tests all pass, but the exit code of py.test is non-zero)