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.
This commit is contained in:
Guido van Rossum 1999-08-18 21:51:10 +00:00
parent 8a07baef80
commit 1ebcf6aabb
1 changed files with 2 additions and 0 deletions

View File

@ -437,6 +437,8 @@ class FTP:
except error_perm, msg:
if msg[:3] != '500':
raise error_perm, msg
elif dirname == '':
dirname = '.' # does nothing, but could return error
cmd = 'CWD ' + dirname
return self.voidcmd(cmd)