From 243cb807e970e19d54fbebea19d6f3130403272d Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Sat, 1 Jun 2013 08:24:31 -0700 Subject: [PATCH] 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. --- Lib/urllib.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/urllib.py b/Lib/urllib.py index f9655f9e88a4..32b4919f07fb 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -870,8 +870,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 -- 2.47.3