cpython/Lib/test/test_asyncio
Vincent Michel 63deaa5b70 bpo-31922: Do not connect UDP sockets when broadcast is allowed (GH-423)
*Moved from python/asyncio#493.*

This PR fixes issue python/asyncio#480, as explained in [this comment](https://github.com/python/asyncio/issues/480#issuecomment-278703828).

The `_SelectorDatagramTransport.sendto` method has to be modified ~~so `_sock.sendto` is used in all cases (because it is tricky to reliably tell if the socket is connected or not). Could that be an issue for connected sockets?~~ *EDIT* ... so `_sock.send` is used only if `_sock` is connected.

It also protects `socket.getsockname` against `OSError` in `_SelectorTransport`. This might happen on Windows if the socket is not connected (e.g. for UDP broadcasting).


https://bugs.python.org/issue31922
2019-05-07 10:18:49 -07:00
..
__init__.py
__main__.py
echo.py
echo2.py
echo3.py
functional.py bpo-35934: Add socket.create_server() utility function (GH-11784) 2019-04-09 00:34:02 +02:00
test_base_events.py bpo-31922: Do not connect UDP sockets when broadcast is allowed (GH-423) 2019-05-07 10:18:49 -07:00
test_buffered_proto.py
test_context.py
test_events.py bpo-35934: Add socket.create_server() utility function (GH-11784) 2019-04-09 00:34:02 +02:00
test_futures.py
test_locks.py
test_pep492.py
test_proactor_events.py
test_protocols.py
test_queues.py
test_runners.py
test_selector_events.py bpo-31922: Do not connect UDP sockets when broadcast is allowed (GH-423) 2019-05-07 10:18:49 -07:00
test_sendfile.py
test_server.py bpo-36341: Fix tests calling bind() on AF_UNIX sockets (GH-12399) 2019-05-03 08:09:17 -07:00
test_sock_lowlevel.py
test_sslproto.py bpo-34745: Fix asyncio sslproto memory issues (GH-12386) 2019-03-17 18:51:10 -04:00
test_streams.py Forbid creating of stream objects outside of asyncio (#13101) 2019-05-06 22:52:11 -04:00
test_subprocess.py Forbid creating of stream objects outside of asyncio (#13101) 2019-05-06 22:52:11 -04:00
test_tasks.py bpo-24638: Improve the error message in asyncio.ensure_future() (#12848) 2019-05-03 11:35:25 -04:00
test_transports.py
test_unix_events.py
test_windows_events.py
test_windows_utils.py
utils.py