summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2013-06-01 15:27:53 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2013-06-01 15:27:53 (GMT)
commite9ec2e173d6a37d3450d900b42bc5f1584b490d4 (patch)
tree0f3b34dbe3b3258ddea416b1f1c336cdab5a835c /Lib/urllib
parent5cfbd2642c32c7b439c1409d649c8bc906990391 (diff)
parent4e42ae81f6a45f40a3f6a64192575bfc44f61bdb (diff)
downloadcpython-e9ec2e173d6a37d3450d900b42bc5f1584b490d4.zip
cpython-e9ec2e173d6a37d3450d900b42bc5f1584b490d4.tar.gz
cpython-e9ec2e173d6a37d3450d900b42bc5f1584b490d4.tar.bz2
merge from 3.3
Fix #17967: For ftp urls CWD to target instead of hopping to each directory towards target. This fixes a bug where target is accessible, but parent directories are restricted.
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index fdb1ec8..1de6aae 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2303,8 +2303,7 @@ class ftpwrapper:
self.ftp = ftplib.FTP()
self.ftp.connect(self.host, self.port, self.timeout)
self.ftp.login(self.user, self.passwd)
- for dir in self.dirs:
- self.ftp.cwd(dir)
+ self.ftp.cwd(os.path.join(*self.dirs))
def retrfile(self, file, type):
import ftplib