Commits

Janusz Harkot  committed 3894938

use ftplib's native size method

  • Participants
  • Parent commits 35d571f

Comments (0)

Files changed (1)

File storages/backends/ftp.py

 
     def size(self, name):
         self._start_connection()
-        try:
-            dirs, files = self._get_dir_details(os.path.dirname(name))
-            if os.path.basename(name) in files:
-                return files[os.path.basename(name)]
-            else:
-                return 0
-        except FTPStorageException, e:
-            return 0
+        return self._connection.size(name)
 
     def url(self, name):
         if self._base_url is None: