[MERGE] Support FTP servers with non-atomic rename (bug #89436)

Alexander Belchenko bialix at ukr.net
Wed Apr 18 05:43:21 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko пишет:
> Aaron Bentley ?8H5B:
>> Alexander Belchenko wrote:
>>> Aaron, with your patch merged I have much more failing FTP tests on win32 than before.
>>> Now I have 33 failed tests (60 total count).
>> Sorry about that.  I will fix it.  It appears to be breaking because we
>> aren't getting a useful exception when a rename fails, but since I force
>> the error, I'm surprised it's not the same on *nix and win32.
> 
> It's strange, but I have errors in Ftp tests only with Python2.5,
> but not with Python2.4. And probably because error handling in Medusa(?)
> expect special format of python exception message. Because in Python 2.5
> these messages looks slightly different.
> 
> In the test.log I see following:
> 
> _ftp_channel: ==> 550 RNTO failed: [Error 2]
> unable to understand error for path: /from/dir/foo: 550 RNTO failed: [Error 2]
> _ftp_channel error: uncaptured python exception, closing channel <bzrlib.transport.ftp.ftp_channel
> connected 127.0.0.1:3425 at 0x231ab48> (<class 'socket.error'>:(10038, 'Socket operation on
> non-socket') [C:\Python25\lib\asynchat.py|handle_read|89] [C:\Python25\lib\asyncore.py|recv|342])
> 
> 
> This message: 'unable to understand error for path' looks suspicious.
> IIRC, in Python 2.4 exception message reports error number as [Errno 2].
> 
> So, Aaron, I think with your patch is all OK, sorry for my complains.
> But something wrong with Medusa on Python2.5.

More testing. RNTO functionality implemented in our codebase, not in Medusa.
I can force the same errors and in Python2.4 when I do this change:

=== modified file 'bzrlib/transport/ftp.py'
- --- bzrlib/transport/ftp.py     2007-04-17 00:59:30 +0000
+++ bzrlib/transport/ftp.py     2007-04-18 04:37:46 +0000
@@ -701,7 +701,8 @@
             except (IOError, OSError), e:
                 # TODO: jam 20060516 return custom responses based on
                 #       why the command failed
- -                self.respond('550 RNTO failed: %s' % (e,))
+#                self.respond('550 RNTO failed: %s' % (e,))
+                self.respond('550 RNTO failed')
             except:
                 self.respond('550 RNTO failed')
                 # For a test server, we will go ahead and just die

After this change Ftp tests failed the same on 2.4 and 2.5 Python.
So it's definitely problem in some(?) code, that expects some special formatted
error string.

Do I need to prepare expected error string manually for Python 2.5,
or this problem could be solved in different way? May be TODO from jam
is related for this problem?

[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGJaHpzYr338mxwCURAsBNAJkBpkbsU/t/85IfGMcfnXF0n3dcxwCgg2lV
+Kqp7L/BMQZttV8WjQm9gbU=
=fYvo
-----END PGP SIGNATURE-----



More information about the bazaar mailing list