summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-03-04 12:10:33 (GMT)
committerGuido van Rossum <guido@python.org>1994-03-04 12:10:33 (GMT)
commitd66acb45f8b44495379e20a4eceb2eea1ec921b2 (patch)
treebe49acacc3d6357a080c6bfa7fc8175aa59cb8f7
parent5e334d9823549b78cdaeb528af255c1a88419651 (diff)
downloadcpython-d66acb45f8b44495379e20a4eceb2eea1ec921b2.zip
cpython-d66acb45f8b44495379e20a4eceb2eea1ec921b2.tar.gz
cpython-d66acb45f8b44495379e20a4eceb2eea1ec921b2.tar.bz2
avoid crash in open_ftp when no host in url
-rwxr-xr-xLib/urlopen.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/urlopen.py b/Lib/urlopen.py
index 0f3c33a..47f0f20 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: