Commit d34687ae authored by Guido van Rossum's avatar Guido van Rossum

avoid crash in open_ftp when no host in url

parent 832722ee
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment