From 964c25f1d91d2f56bf3924b1d1feefaeb3b3b2c5 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Sun, 2 Jun 2013 11:59:09 -0700 Subject: [PATCH] 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. --- Lib/urllib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/urllib.py b/Lib/urllib.py index 09a054b623cb..244cb05374d1 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -873,7 +873,8 @@ class ftpwrapper: 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 -- 2.47.3