Rev 5078: (mbp) cope with ftp servers giving 250 reply for mkd (bug 224373) (Martin in file:///home/pqm/archives/thelove/bzr/2.2/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Aug 17 03:14:26 BST 2010


At file:///home/pqm/archives/thelove/bzr/2.2/

------------------------------------------------------------
revno: 5078 [merge]
revision-id: pqm at pqm.ubuntu.com-20100817021423-wegvm3ai25d0h0sb
parent: pqm at pqm.ubuntu.com-20100816162812-bp9x8l35xzxiutp1
parent: mbp at sourcefrog.net-20100817004854-cwa2i6my1le4b9ns
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.2
timestamp: Tue 2010-08-17 03:14:23 +0100
message:
  (mbp) cope with ftp servers giving 250 reply for mkd (bug 224373) (Martin
   Pool)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
=== modified file 'NEWS'
--- a/NEWS	2010-08-13 19:08:57 +0000
+++ b/NEWS	2010-08-17 02:14:23 +0000
@@ -20,6 +20,9 @@
 * CommitBuilder now uses the committer instead of _config.username to generate
   the revision-id.  (Aaron Bentley, #614404)
 
+* Cope with Microsoft FTP server that returns reply '250 Directory
+  created' when mkdir succeeds.  (Martin Pool, #224373)
+
 Improvements
 ************
 

=== modified file 'bzrlib/transport/ftp/__init__.py'
--- a/bzrlib/transport/ftp/__init__.py	2010-02-27 01:37:54 +0000
+++ b/bzrlib/transport/ftp/__init__.py	2010-08-17 00:48:54 +0000
@@ -350,7 +350,17 @@
         try:
             mutter("FTP mkd: %s", abspath)
             f = self._get_FTP()
-            f.mkd(abspath)
+            try:
+                f.mkd(abspath)
+            except ftplib.error_reply, e:
+                # <https://bugs.launchpad.net/bzr/+bug/224373> Microsoft FTP
+                # server returns "250 Directory created." which is kind of
+                # reasonable, 250 meaning "requested file action OK", but not what
+                # Python's ftplib expects.
+                if e[0][:3] == '250':
+                    pass
+                else:
+                    raise
             self._setmode(relpath, mode)
         except ftplib.error_perm, e:
             self._translate_ftp_error(e, abspath,




More information about the bazaar-commits mailing list