assumes that "addr" (which is returned from socket.accept()) is a pair (2-tuple). But according to https://docs.python.org/2/library/socket.html, an IPv6 address will be represented as a four-tuple (host, port, flowspec, scope). In this case we can safely ignore flowspec and scope, but we must be able to parse this four-tuple variant of addr.
The line
host, port = addr
assumes that "addr" (which is returned from socket.accept()) is a pair (2-tuple). But according to https:/ /docs.python. org/2/library/ socket. html, an IPv6 address will be represented as a four-tuple (host, port, flowspec, scope). In this case we can safely ignore flowspec and scope, but we must be able to parse this four-tuple variant of addr.