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

Skip to content

Commit 1ebcf6a

Browse files
committed
Patches by Michael Reilly to correctly deal with ftp URLs of the form
ftp://user@host//root/path: the double slash in the pathname means to go to the root directory even if the initial directory isn't the root.
1 parent 8a07bae commit 1ebcf6a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/ftplib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ def cwd(self, dirname):
437437
except error_perm, msg:
438438
if msg[:3] != '500':
439439
raise error_perm, msg
440+
elif dirname == '':
441+
dirname = '.' # does nothing, but could return error
440442
cmd = 'CWD ' + dirname
441443
return self.voidcmd(cmd)
442444

0 commit comments

Comments
 (0)