From 106afad09c384a44106af2e227fbd019680683fb Mon Sep 17 00:00:00 2001 From: Max Coplan Date: Wed, 10 Jun 2020 16:36:17 -0400 Subject: [PATCH] Document base_events.py --- Lib/asyncio/base_events.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 3748da6e260..4e6be9f7051 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -139,6 +139,8 @@ def _ipaddr_info(host, port, family, type, proto, flowinfo=0, scopeid=0): if isinstance(host, bytes): host = host.decode('idna') + # Even though we're calling str() on host (so we'll convert arbitrary objects to str), + # we're restricting it to a valid IP address later when calling socket.inet_pton(). host = str(host) if '%' in host: # Linux's inet_pton doesn't accept an IPv6 zone index after host,