def isdir(self): try: self._conn.size(self.url.path) except ftplib.error_perm as err: if "regular" in str(err): return True return False