Document base_events.py

This commit is contained in:
Max Coplan 2020-06-10 16:36:17 -04:00 committed by Max Coplan
parent 87f466f0e7
commit 106afad09c
1 changed files with 2 additions and 0 deletions

View File

@ -139,6 +139,8 @@ def _ipaddr_info(host, port, family, type, proto, flowinfo=0, scopeid=0):
if isinstance(host, bytes): if isinstance(host, bytes):
host = host.decode('idna') 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) host = str(host)
if '%' in host: if '%' in host:
# Linux's inet_pton doesn't accept an IPv6 zone index after host, # Linux's inet_pton doesn't accept an IPv6 zone index after host,