Commit 63deaa5
*Moved from python/asyncio#493.*
This PR fixes issue python/asyncio#480, as explained in [this comment](python/asyncio#480 (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
1 parent 91cc01f commit 63deaa5
File tree
5 files changed
+34
-7
lines changed- Lib
- asyncio
- test/test_asyncio
- Misc/NEWS.d/next/Library
5 files changed
+34
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1306 | 1306 | | |
1307 | 1307 | | |
1308 | 1308 | | |
1309 | | - | |
| 1309 | + | |
| 1310 | + | |
1310 | 1311 | | |
1311 | 1312 | | |
1312 | 1313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
591 | 594 | | |
592 | 595 | | |
593 | 596 | | |
| |||
976 | 979 | | |
977 | 980 | | |
978 | 981 | | |
979 | | - | |
980 | | - | |
981 | | - | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
982 | 987 | | |
983 | 988 | | |
984 | 989 | | |
| |||
989 | 994 | | |
990 | 995 | | |
991 | 996 | | |
992 | | - | |
| 997 | + | |
993 | 998 | | |
994 | 999 | | |
995 | 1000 | | |
| |||
1012 | 1017 | | |
1013 | 1018 | | |
1014 | 1019 | | |
1015 | | - | |
| 1020 | + | |
1016 | 1021 | | |
1017 | 1022 | | |
1018 | 1023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1586 | 1586 | | |
1587 | 1587 | | |
1588 | 1588 | | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
1589 | 1606 | | |
1590 | 1607 | | |
1591 | 1608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
| 1068 | + | |
1068 | 1069 | | |
1069 | 1070 | | |
1070 | 1071 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments