Rev 5380: (mbp) slightly better error handling in ftp transport (Martin Pool) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Aug 18 02:29:14 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5380 [merge]
revision-id: pqm at pqm.ubuntu.com-20100818012912-wwgerzeui5ldf5lh
parent: pqm at pqm.ubuntu.com-20100817084732-nqa09at3c7h0wb7u
parent: mbp at sourcefrog.net-20100817015017-jbl9qzljjg1iub69
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2010-08-18 02:29:12 +0100
message:
  (mbp) slightly better error handling in ftp transport (Martin Pool)
modified:
  bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
=== modified file 'bzrlib/transport/ftp/__init__.py'
--- a/bzrlib/transport/ftp/__init__.py	2010-08-17 00:48:54 +0000
+++ b/bzrlib/transport/ftp/__init__.py	2010-08-18 01:29:12 +0000
@@ -191,6 +191,9 @@
             or 'file/directory not found' in s # filezilla server
             # Microsoft FTP-Service RNFR reply if file not found
             or (s.startswith('550 ') and 'unable to rename to' in extra)
+            # if containing directory doesn't exist, suggested by
+            # <https://bugs.edge.launchpad.net/bzr/+bug/224373>
+            or (s.startswith('550 ') and "can't find folder" in s)
             ):
             raise errors.NoSuchFile(path, extra=extra)
         elif ('file exists' in s):
@@ -314,8 +317,9 @@
                     return len(bytes)
                 else:
                     return fp.counted_bytes
-            except (ftplib.error_temp,EOFError), e:
-                warning("Failure during ftp PUT. Deleting temporary file.")
+            except (ftplib.error_temp, EOFError), e:
+                warning("Failure during ftp PUT of %s: %s. Deleting temporary file."
+                    % (tmp_abspath, e, ))
                 try:
                     f.delete(tmp_abspath)
                 except:
@@ -328,8 +332,9 @@
                                        unknown_exc=errors.NoSuchFile)
         except ftplib.error_temp, e:
             if retries > _number_of_retries:
-                raise errors.TransportError("FTP temporary error during PUT %s. Aborting."
-                                     % self.abspath(relpath), orig_error=e)
+                raise errors.TransportError(
+                    "FTP temporary error during PUT %s: %s. Aborting."
+                    % (self.abspath(relpath), e), orig_error=e)
             else:
                 warning("FTP temporary error: %s. Retrying.", str(e))
                 self._reconnect()




More information about the bazaar-commits mailing list