summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-12-02 20:26:21 (GMT)
committerGuido van Rossum <guido@python.org>1997-12-02 20:26:21 (GMT)
commitc0f29c2d31b9be8ffd60083e3724f90d13bd0cf4 (patch)
tree2844053f34c51ae5c94ced9b81d99510e2016fce /Lib/urllib.py
parent240ddc8a68ab3a35ed0e1bfe030debaa6bc7ecb6 (diff)
downloadcpython-c0f29c2d31b9be8ffd60083e3724f90d13bd0cf4.zip
cpython-c0f29c2d31b9be8ffd60083e3724f90d13bd0cf4.tar.gz
cpython-c0f29c2d31b9be8ffd60083e3724f90d13bd0cf4.tar.bz2
When a port is specified in an ftp:// URL, must convert it to a number!
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 02edb3b..a16529a 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -323,6 +323,8 @@ class URLopener:
if not port:
import ftplib
port = ftplib.FTP_PORT
+ else:
+ port = int(port)
path, attrs = splitattr(path)
dirs = string.splitfields(path, '/')
dirs, file = dirs[:-1], dirs[-1]