summaryrefslogtreecommitdiff
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2013-06-01 08:27:06 -0700
committerSenthil Kumaran <senthil@uthcode.com>2013-06-01 08:27:06 -0700
commit4e42ae81f6a45f40a3f6a64192575bfc44f61bdb (patch)
treebca8f7e98ae36223f14111d95ed3a11ef8729eda /Lib/urllib/request.py
parent7d15b54f370ae46a294aea54dd8dc788ec4b0c3c (diff)
downloadcpython-git-4e42ae81f6a45f40a3f6a64192575bfc44f61bdb.tar.gz
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/request.py')
-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 786055ef0b..1279322496 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2273,8 +2273,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