From: Guido van Rossum Date: Wed, 18 Aug 1999 21:51:10 +0000 (+0000) Subject: Patches by Michael Reilly to correctly deal with ftp URLs of the form X-Git-Tag: v1.6a1~1001 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ebcf6aabb357de166f226d1355baefc541950e9;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/ftplib.py b/Lib/ftplib.py index d2ff43570042..eee8e5a82650 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -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)