> +++ httplib.py 14 Sep 2004 17:55:21 -0000 1.89
> @@ -525,7 +525,8 @@
> def _set_hostport(self, host, port):
> if port is None:
> i = host.rfind(':')
> - if i >= 0:
> + j = host.rfind(']') # ipv6 addresses have [...]
> + if i > j:
one-line alternative:
i = host.find(":", host.rfind("]"))
</F>