File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 16
16
import collections
17
17
import collections .abc
18
18
import concurrent .futures
19
+ import errno
19
20
import functools
20
21
import heapq
21
22
import itertools
@@ -1585,9 +1586,22 @@ async def create_server(
1585
1586
try :
1586
1587
sock .bind (sa )
1587
1588
except OSError as err :
1588
- raise OSError (err .errno , 'error while attempting '
1589
- 'to bind on address %r: %s'
1590
- % (sa , err .strerror .lower ())) from None
1589
+ msg = ('error while attempting '
1590
+ 'to bind on address %r: %s'
1591
+ % (sa , err .strerror .lower ()))
1592
+ if err .errno == errno .EADDRNOTAVAIL :
1593
+ # Assume the family is not enabled (bpo-30945)
1594
+ sockets .pop ()
1595
+ sock .close ()
1596
+ if self ._debug :
1597
+ logger .warning (msg )
1598
+ continue
1599
+ raise OSError (err .errno , msg ) from None
1600
+
1601
+ if not sockets :
1602
+ raise OSError ('could not bind on any address out of %r'
1603
+ % ([info [4 ] for info in infos ],))
1604
+
1591
1605
completed = True
1592
1606
finally :
1593
1607
if not completed :
Original file line number Diff line number Diff line change
1
+ Ignore an :exc: `OSError ` in :meth: `asyncio.BaseEventLoop.create_server ` when
2
+ IPv6 is available but the interface cannot actually support it.
You can’t perform that action at this time.
0 commit comments