Closes #22275: asyncio: enhance documentation of OS support

--HG--
branch : 3.4
(Merge 3.4) Closes #22275: asyncio: enhance documentation of OS support
asyncio, Tulip issue 205: Fix a race condition in BaseSelectorEventLoop.sock_connect()

There is a race condition in create_connection() used with wait_for() to have a
timeout. sock_connect() registers the file descriptor of the socket to be
notified of write event (if connect() raises BlockingIOError). When
create_connection() is cancelled with a TimeoutError, sock_connect() coroutine
gets the exception, but it doesn't unregister the file descriptor for write
event. create_connection() gets the TimeoutError and closes the socket.

If you call again create_connection(), the new socket will likely gets the same
file descriptor, which is still registered in the selector. When sock_connect()
calls add_writer(), it tries to modify the entry instead of creating a new one.

This issue was originally reported in the Trollius project, but the bug comes
from Tulip in fact (Trollius is based on Tulip):
https://bitbucket.org/enovance/trollius/issue/15/after-timeouterror-on-wait_for

This change fixes the race condition. It also makes sock_connect() more
reliable (and portable) is sock.connect() raises an InterruptedError.

--HG--
branch : 3.4
(Merge 3.4) asyncio, Tulip issue 205: Fix a race condition in
BaseSelectorEventLoop.sock_connect()

There is a race condition in create_connection() used with wait_for() to have a
timeout. sock_connect() registers the file descriptor of the socket to be
notified of write event (if connect() raises BlockingIOError). When
create_connection() is cancelled with a TimeoutError, sock_connect() coroutine
gets the exception, but it doesn't unregister the file descriptor for write
event. create_connection() gets the TimeoutError and closes the socket.

If you call again create_connection(), the new socket will likely gets the same
file descriptor, which is still registered in the selector. When sock_connect()
calls add_writer(), it tries to modify the entry instead of creating a new one.

This issue was originally reported in the Trollius project, but the bug comes
from Tulip in fact (Trollius is based on Tulip):
https://bitbucket.org/enovance/trollius/issue/15/after-timeouterror-on-wait_for

This change fixes the race condition. It also makes sock_connect() more
reliable (and portable) is sock.connect() raises an InterruptedError.
Remove unused import

--HG--
branch : 3.4
Correct indent

--HG--
branch : 3.4
#22315: Add test to capture the failure.

--HG--
branch : 3.4
merge 3.4
#22315: Use technique outlined in test_file_util

--HG--
branch : 3.4
extra : amend_source : 912d6db93e369bb829cf47a6683c1a4640697378
#22315: Provide an actual directory during test invocation.

--HG--
branch : 3.4
extra : amend_source : 81106b92967b222b9ade57b6019b2dac814de8f9
#22315: Use an existent directory for 'src' to trigger appropriate behavior.

--HG--
branch : 3.4
#22315: Use advertised API for OSError

--HG--
branch : 3.4
extra : rebase_source : 9bced561bd8b545f0f0fe5bc222030a586462c2f
Merge with 3.4; Closes #22315