Rev 4825: Backport fixes bug #526211 and bug #526353, add NEWS entry. in file:///home/vila/src/bzr/bugs/526221-failing-sftp-tests/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Mar 5 08:48:31 GMT 2010


At file:///home/vila/src/bzr/bugs/526221-failing-sftp-tests/

------------------------------------------------------------
revno: 4825
revision-id: v.ladeuil+lp at free.fr-20100305084831-z0v2gq81t1biae4q
parent: pqm at pqm.ubuntu.com-20100305082106-0e13lwd00apytqvj
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 526221-failing-sftp-tests
timestamp: Fri 2010-03-05 09:48:31 +0100
message:
  Backport fixes bug #526211 and bug #526353, add NEWS entry.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2010-03-05 07:49:31 +0000
+++ b/NEWS	2010-03-05 08:48:31 +0000
@@ -14,6 +14,9 @@
 Bug Fixes
 *********
 
+* Fix stub sftp test server to call os.getcwdu().
+  (Vincent Ladeuil, #526211, #526353)
+
 * Merge correctly when this_tree is not a WorkingTree.  (Aaron Bentley)
 
 * Register SIGWINCH handler only when creating a ``TextUIFactory``; avoids

=== modified file 'bzrlib/tests/stub_sftp.py'
--- a/bzrlib/tests/stub_sftp.py	2010-02-17 17:11:16 +0000
+++ b/bzrlib/tests/stub_sftp.py	2010-03-05 08:48:31 +0000
@@ -297,14 +297,14 @@
                 threading.Thread(target=self._callback, args=(s,)).start()
             except socket.error, x:
                 sys.excepthook(*sys.exc_info())
-                warning('Socket error during accept() within unit test server'
-                        ' thread: %r' % x)
+                trace.warning('Socket error during accept() '
+                              'within unit test server thread: %r' % x)
             except Exception, x:
                 # probably a failed test; unit test thread will log the
                 # failure/error
                 sys.excepthook(*sys.exc_info())
-                warning('Exception from within unit test server thread: %r' %
-                        x)
+                trace.warning(
+                    'Exception from within unit test server thread: %r' % x)
 
 
 class SocketDelay(object):
@@ -438,13 +438,15 @@
         if not (backing_server is None or
                 isinstance(backing_server, local.LocalURLServer)):
             raise AssertionError(
-                "backing_server should not be %r, because this can only serve the "
-                "local current working directory." % (backing_server,))
+                'backing_server should not be %r, because this can only serve '
+                'the local current working directory.' % (backing_server,))
         self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor
         ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor
+        # FIXME: the following block should certainly just be self._homedir =
+        # osutils.getcwd() but that fails badly on Unix -- vila 20100224
         if sys.platform == 'win32':
             # Win32 needs to use the UNICODE api
-            self._homedir = getcwd()
+            self._homedir = os.getcwdu()
         else:
             # But Linux SFTP servers should just deal in bytestreams
             self._homedir = os.getcwd()



More information about the bazaar-commits mailing list