Message298683
Better than trying to detect IPv6 compatibility beforehand would probably to recognize the error and simply ignore it.
Note: errno 99 is EADDRNOTAVAIL.
Something like this could work (untested):
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 33b8f48..413161a 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -1038,6 +1038,11 @@ class BaseEventLoop(events.AbstractEventLoop):
try:
sock.bind(sa)
except OSError as err:
+ if err.errno == errno.EADDRNOTAVAIL:
+ # See bpo-30945
+ sockets.pop()
+ sock.close()
+ continue
raise OSError(err.errno, 'error while attempting '
'to bind on address %r: %s'
% (sa, err.strerror.lower())) from None |
|
Date |
User |
Action |
Args |
2017-07-19 17:51:14 | pitrou | set | recipients:
+ pitrou, yselivanov, cecton |
2017-07-19 17:51:14 | pitrou | set | messageid: <1500486674.47.0.672866065843.issue30945@psf.upfronthosting.co.za> |
2017-07-19 17:51:14 | pitrou | link | issue30945 messages |
2017-07-19 17:51:14 | pitrou | create | |
|