From: Raymond Hettinger Date: Thu, 14 Oct 2004 15:23:38 +0000 (+0000) Subject: SF bug #1046855: httplib index out of range X-Git-Tag: v2.4b1~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d03791632a9b7a6d96640df09466969aec81b71;p=thirdparty%2FPython%2Fcpython.git SF bug #1046855: httplib index out of range --- diff --git a/Lib/httplib.py b/Lib/httplib.py index d4fcf7c2d52a..72e8a7253988 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -593,7 +593,7 @@ class HTTPConnection: host = host[:i] else: port = self.default_port - if host[0] == '[' and host[-1] == ']': + if host and host[0] == '[' and host[-1] == ']': host = host[1:-1] self.host = host self.port = port