diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2013-06-01 15:27:53 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2013-06-01 15:27:53 (GMT) |
commit | e9ec2e173d6a37d3450d900b42bc5f1584b490d4 (patch) | |
tree | 0f3b34dbe3b3258ddea416b1f1c336cdab5a835c | |
parent | 5cfbd2642c32c7b439c1409d649c8bc906990391 (diff) | |
parent | 4e42ae81f6a45f40a3f6a64192575bfc44f61bdb (diff) | |
download | cpython-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.
-rw-r--r-- | Lib/urllib/request.py | 3 |
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 |