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

senthil.kumaran python-checkins at python.org
Sun Jun 2 21:00:54 CEST 2013


http://hg.python.org/cpython/rev/adfec512fb32
changeset:   84017:adfec512fb32
parent:      84014:49bcd1af0f49
parent:      84016:f5906026a7e9
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Sun Jun 02 12:00:45 2013 -0700
summary:
  merge from 3.3

Fix #17967 - Fix related to regression on Windows.

os.path.join(*self.dirs) produces an invalid path on windows.
ftp paths are always forward-slash seperated like this. /pub/dir.

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


diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2306,7 +2306,8 @@
         self.ftp = ftplib.FTP()
         self.ftp.connect(self.host, self.port, self.timeout)
         self.ftp.login(self.user, self.passwd)
-        self.ftp.cwd(os.path.join(*self.dirs))
+        _target = '/'.join(self.dirs)
+        self.ftp.cwd(_target)
 
     def retrfile(self, file, type):
         import ftplib

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


More information about the Python-checkins mailing list