]> granicus.if.org Git - python/commitdiff
Patch #1470976: don't NLST files when retrieving over FTP.
authorGeorg Brandl <georg@python.org>
Sun, 30 Apr 2006 09:23:59 +0000 (09:23 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 30 Apr 2006 09:23:59 +0000 (09:23 +0000)
Lib/urllib.py

index c1f6f60bcea2addfb44246346384e49e0e434a2d..5c02883f63e18cb435fac60e6eaf4631c8d82e50 100644 (file)
@@ -856,13 +856,6 @@ class ftpwrapper:
             self.ftp.voidcmd(cmd)
         conn = None
         if file and not isdir:
-            # Use nlst to see if the file exists at all
-            try:
-                self.ftp.nlst(file)
-            except ftplib.error_perm, reason:
-                raise IOError, ('ftp error', reason), sys.exc_info()[2]
-            # Restore the transfer mode!
-            self.ftp.voidcmd(cmd)
             # Try to retrieve as a file
             try:
                 cmd = 'RETR ' + file