From cae14d2714f363445d8ac0d631dc102b0ef292a9 Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Tue, 14 Sep 2004 17:55:21 +0000 Subject: missed the obvious test case and corresponding fix --- Lib/httplib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/httplib.py') diff --git a/Lib/httplib.py b/Lib/httplib.py index 2f117d8d5d..b7276af357 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -525,7 +525,8 @@ class HTTPConnection: 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: try: port = int(host[i+1:]) except ValueError: -- cgit v1.2.1