Skip to content

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 7, 2019

Moved from python/asyncioGH-493.

This PR fixes issue python/asyncioGH-480, as explained in this comment.

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
(cherry picked from commit 63deaa5)

Co-authored-by: Vincent Michel vxgmichel@gmail.com

https://bugs.python.org/issue31922

…onGH-423)

*Moved from python/asyncioGH-493.*

This PR fixes issue python/asyncioGH-480, as explained in [this comment](https://github.com/python/asyncio/issues/480GH-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
(cherry picked from commit 63deaa5)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
@miss-islington
Copy link
Contributor Author

@vxgmichel: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 19ca5b5 into python:3.7 May 7, 2019
@miss-islington miss-islington deleted the backport-63deaa5-3.7 branch May 7, 2019 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants