[Python-checkins] cpython (2.7): Fix #17967 - Fix related to regression on Windows.

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


http://hg.python.org/cpython/rev/e9d0fb934b46
changeset:   84015:e9d0fb934b46
branch:      2.7
parent:      84010:4657d0eebe42
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Sun Jun 02 11:59:09 2013 -0700
summary:
  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.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


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