Author Alisue Lambda
Recipients Alisue Lambda, asvetlov, yselivanov
Date 2018-04-24.16:51:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524588676.0.0.682650639539.issue33350@psf.upfronthosting.co.za>
In-reply-to
Content
This is my first time to create an issue on the python bug tracker so let me know if I don't follow the rule which I need to follow.

# Summary

Using 'loop.sock_connect' with 'asyncio.wait_for' raises 'OSError [WinError 10038]' in Windows 10 Pro when timed-out.

# Detail

I use 'loop.sock_connect' to establish a TCP connection for checking if a particular port on a target host is available.
However, when I wrap the coroutine with 'asyncio.wait_for', the following exception is raised when the wrapped coroutine has timed-out.

    Traceback (most recent call last):
      File "C:\Users\alisue/test.py", line 41, in <module>
        loop.run_until_complete(test(loop))
      File "C:\Python36\lib\asyncio\base_events.py", line 454, in run_until_complete
        self.run_forever()
      File "C:\Python36\lib\asyncio\base_events.py", line 421, in run_forever
        self._run_once()
      File "C:\Python36\lib\asyncio\base_events.py", line 1395, in _run_once
        event_list = self._selector.select(timeout)
      File "C:\Python36\lib\selectors.py", line 323, in select
        r, w, _ = self._select(self._readers, self._writers, [], timeout)
      File "C:\Python36\lib\selectors.py", line 314, in _select
        r, w, x = select.select(r, w, w, timeout)
    OSError: [WinError 10038] ...........

While it is raised from 'lib\selectors.py', I cannot catch this exception so the event loop has halted.

The attached 'test.py' is a minimum script to reproduce the error.

Thanks.
History
Date User Action Args
2018-04-24 16:51:16Alisue Lambdasetrecipients: + Alisue Lambda, asvetlov, yselivanov
2018-04-24 16:51:16Alisue Lambdasetmessageid: <1524588676.0.0.682650639539.issue33350@psf.upfronthosting.co.za>
2018-04-24 16:51:15Alisue Lambdalinkissue33350 messages
2018-04-24 16:51:15Alisue Lambdacreate