Rev 4064: merge fix for python-2.4 compatibility in http://bazaar.launchpad.net/%7Evila/bzr/bzr.integration

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Feb 27 08:46:38 GMT 2009


At http://bazaar.launchpad.net/%7Evila/bzr/bzr.integration

------------------------------------------------------------
revno: 4064
revision-id: v.ladeuil+lp at free.fr-20090227084553-ritia8ukxh8i25po
parent: v.ladeuil+lp at free.fr-20090227082909-6i864fof6qyksm87
parent: v.ladeuil+lp at free.fr-20090227084436-4j9864kycsieuycj
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: bzr.integration
timestamp: Fri 2009-02-27 09:45:53 +0100
message:
  merge fix for python-2.4 compatibility
modified:
  bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
    ------------------------------------------------------------
    revno: 3508.1.6
    revision-id: v.ladeuil+lp at free.fr-20090227084436-4j9864kycsieuycj
    parent: v.ladeuil+lp at free.fr-20090227082647-0x7w9vvzbwooisb0
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: binary-mode
    timestamp: Fri 2009-02-27 09:44:36 +0100
    message:
      Fix python-2.4 compatibility.
      
      * bzrlib/transport/ftp/__init__.py:
      (FtpTransport.list_dir): try/except/finally features are reduced
      under python-2.4.
    modified:
      bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
-------------- next part --------------
=== modified file 'bzrlib/transport/ftp/__init__.py'
--- a/bzrlib/transport/ftp/__init__.py	2009-02-26 19:30:06 +0000
+++ b/bzrlib/transport/ftp/__init__.py	2009-02-27 08:44:36 +0000
@@ -519,19 +519,21 @@
         mutter("FTP nlst: %s", basepath)
         f = self._get_FTP()
         try:
-            paths = f.nlst(basepath)
-        except ftplib.error_perm, e:
-            self._translate_perm_error(e, relpath, extra='error with list_dir')
-        except ftplib.error_temp, e:
-            # xs4all's ftp server raises a 450 temp error when listing an empty
-            # directory. Check for that and just return an empty list in that
-            # case. See bug #215522
-            if str(e).lower().startswith('450 no files found'):
-                mutter('FTP Server returned "%s" for nlst.'
-                       ' Assuming it means empty directory',
-                       str(e))
-                return []
-            raise
+            try:
+                paths = f.nlst(basepath)
+            except ftplib.error_perm, e:
+                self._translate_perm_error(e, relpath,
+                                           extra='error with list_dir')
+            except ftplib.error_temp, e:
+                # xs4all's ftp server raises a 450 temp error when listing an
+                # empty directory. Check for that and just return an empty list
+                # in that case. See bug #215522
+                if str(e).lower().startswith('450 no files found'):
+                    mutter('FTP Server returned "%s" for nlst.'
+                           ' Assuming it means empty directory',
+                           str(e))
+                    return []
+                raise
         finally:
             # Restore binary mode as nlst switch to ascii mode to retrieve file
             # list



More information about the bazaar-commits mailing list