mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
avoid crash in open_ftp when no host in url
This commit is contained in:
parent
5e334d9823
commit
d66acb45f8
1 changed files with 1 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue