Message329399
This error seems to come from base_events.py, lines 142-145, and since it's an OS specific limitation, I can't see Sebastien's suggestion as a feasible solution.
Maybe we could come up with something along the lines of the following patch. What do you think about it?
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 3726c556d4..15ee4d9d1b 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -142,6 +142,9 @@ def _ipaddr_info(host, port, family, type, proto):
if '%' in host:
# Linux's inet_pton doesn't accept an IPv6 zone index after host,
# like '::1%lo0'.
+ if sys.platform.startswith('linux'):
+ return OSError("Linux's inet_pton doesn't accept an IPv6 "
+ "zone index after host")
return None
for af in afs:
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 6d544d1eda..1b944ff89e 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -109,6 +109,9 @@ class BaseEventTests(test_utils.TestCase):
self.assertIsNone(
base_events._ipaddr_info('::3', 1, INET, STREAM, TCP))
+ @unittest.skipIf(sys.platform.startswith('linux'),
+ "Linux's inet_pton doesn't accept an IPv6 zone index after host")
+ def test_for(self):
# IPv6 address with zone index.
self.assertIsNone(
base_events._ipaddr_info('::3%lo0', 1, INET6, STREAM, TCP)) |
|
Date |
User |
Action |
Args |
2018-11-07 00:33:30 | augustogoulart | set | recipients:
+ augustogoulart, taleinat, asvetlov, yselivanov, sebastien.bourdeauducq, apatrushev |
2018-11-07 00:33:30 | augustogoulart | set | messageid: <1541550810.81.0.788709270274.issue33678@psf.upfronthosting.co.za> |
2018-11-07 00:33:30 | augustogoulart | link | issue33678 messages |
2018-11-07 00:33:30 | augustogoulart | create | |
|