summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2004-07-11 17:14:13 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2004-07-11 17:14:13 (GMT)
commit3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1 (patch)
tree018792e0ef797856de01a1e29872a816117ca6cd /Lib/urllib2.py
parente2465087790ecd3a873252a0b7c67772ce1ac911 (diff)
downloadcpython-3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1.zip
cpython-3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1.tar.gz
cpython-3f7cb5d9f5ddafc1a0c79775304fc74b829a11c1.tar.bz2
Patch [ 972332 ] urllib2 FTPHandler bugs / John J. Lee
Modified Files: urllib2.py test/test_urllib2.py
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 84d4c34..8d38749 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -116,7 +116,7 @@ except ImportError:
# not sure how many of these need to be gotten rid of
from urllib import unwrap, unquote, splittype, splithost, \
addinfourl, splitport, splitgophertype, splitquery, \
- splitattr, ftpwrapper, noheaders, splituser, splitpasswd
+ splitattr, ftpwrapper, noheaders, splituser, splitpasswd, splitvalue
# support for FileHandler, proxies via environment variables
from urllib import localhost, url2pathname, getproxies
@@ -1143,6 +1143,8 @@ class FTPHandler(BaseHandler):
host, port = splitport(host)
if port is None:
port = ftplib.FTP_PORT
+ else:
+ port = int(port)
# username/password handling
user, host = splituser(host)
@@ -1168,7 +1170,7 @@ class FTPHandler(BaseHandler):
fw = self.connect_ftp(user, passwd, host, port, dirs)
type = file and 'I' or 'D'
for attr in attrs:
- attr, value = splitattr(attr)
+ attr, value = splitvalue(attr)
if attr.lower() == 'type' and \
value in ('a', 'A', 'i', 'I', 'd', 'D'):
type = value.upper()