From: Guido van Rossum Date: Fri, 4 Mar 1994 12:10:33 +0000 (+0000) Subject: avoid crash in open_ftp when no host in url X-Git-Tag: v1.0.2~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d66acb45f8b44495379e20a4eceb2eea1ec921b2;p=thirdparty%2FPython%2Fcpython.git avoid crash in open_ftp when no host in url --- diff --git a/Lib/urlopen.py b/Lib/urlopen.py index 0f3c33a88feb..47f0f20424c3 100755 --- a/Lib/urlopen.py +++ b/Lib/urlopen.py @@ -169,6 +169,7 @@ class URLopener: # Use FTP protocol def open_ftp(self, url): host, file = splithost(url) + if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) host = socket.gethostbyname(host) if not port: