--- bzrlib/transport/ftp.py +++ bzrlib/transport/ftp.py @@ -40,6 +40,7 @@ from bzrlib.errors import (TransportNotPossible, TransportError, NoSuchFile, FileExists) from bzrlib.trace import mutter, warning +import bzrlib.ui _FTP_cache = {} @@ -107,8 +108,16 @@ self.is_active) return self._FTP_instance except ftplib.error_perm, e: - raise TransportError(msg="Error setting up connection: %s" - % str(e), orig_error=e) + try: + password = bzrlib.ui.ui_factory.get_password( + prompt='FTP %(host)s password', + host=self._host) + self._FTP_instance = _find_FTP(hostname, username, password, + self.is_active) + return self._FTP_instance + except ftplib.error_perm, e: + raise TransportError(msg="Error setting up connection: %s" + % str(e), orig_error=e) def should_cache(self): """Return True if the data pulled across should be cached locally.