[Python-checkins] cpython (merge 3.3 -> default): merge from 3.3

senthil.kumaran python-checkins at python.org
Sat Jun 1 17:28:02 CEST 2013


http://hg.python.org/cpython/rev/c1101f0d6c29
changeset:   84008:c1101f0d6c29
parent:      84004:35da9e3ba697
parent:      84007:dbfbdf2b5c19
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Sat Jun 01 08:27:53 2013 -0700
summary:
  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.

files:
  Lib/urllib/request.py |  3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2303,8 +2303,7 @@
         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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list