summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2004-09-14 17:55:21 (GMT)
committerSkip Montanaro <skip@pobox.com>2004-09-14 17:55:21 (GMT)
commitcae14d2714f363445d8ac0d631dc102b0ef292a9 (patch)
tree01e8a066d6fe02f635df0d79cb08302635630aab /Lib/httplib.py
parent1fd00a1b7185a6bfb575e3ca0303e5fdc9d24498 (diff)
downloadcpython-cae14d2714f363445d8ac0d631dc102b0ef292a9.zip
cpython-cae14d2714f363445d8ac0d631dc102b0ef292a9.tar.gz
cpython-cae14d2714f363445d8ac0d631dc102b0ef292a9.tar.bz2
missed the obvious test case and corresponding fix
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 2f117d8..b7276af 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: