Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit caa00fe

Browse files
committed
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.
1 parent d710017 commit caa00fe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/urllib/request.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2276,7 +2276,8 @@ def init(self):
22762276
self.ftp = ftplib.FTP()
22772277
self.ftp.connect(self.host, self.port, self.timeout)
22782278
self.ftp.login(self.user, self.passwd)
2279-
self.ftp.cwd(os.path.join(*self.dirs))
2279+
_target = '/'.join(self.dirs)
2280+
self.ftp.cwd(_target)
22802281

22812282
def retrfile(self, file, type):
22822283
import ftplib

0 commit comments

Comments
 (0)