# Bazaar revision bundle v0.7 # # message: # absorb a broken-pipe exception from paramiko when running the unit tests. it's okay for the client to vanish abruptly and paramiko really ought to mask the exception itself. # committer: Robey Pointer # date: Thu 2006-06-22 17:19:48.549917936 -0700 === modified file bzrlib/transport/sftp.py --- bzrlib/transport/sftp.py +++ bzrlib/transport/sftp.py @@ -23,6 +23,7 @@ import random import re import select +import socket import stat import subprocess import sys @@ -1030,7 +1031,17 @@ server = paramiko.SFTPServer(FakeChannel(), 'sftp', StubServer(self), StubSFTPServer, root=self._root, home=self._server_homedir) - server.start_subsystem('sftp', None, sock) + try: + server.start_subsystem('sftp', None, sock) + except socket.error, e: + if (len(e.args) > 0) and (e.args[0] == errno.EPIPE): + # it's okay for the client to disconnect abruptly + # (bug in paramiko 1.6: it should absorb this exception) + pass + else: + raise + except Exception, e: + import sys; sys.stderr.write('\nEXCEPTION %r\n\n' % e.__class__) server.finish_subsystem() # revision id: robey@lag.net-20060623001948-c66d75472c755ded # sha1: 2466db3329527c69b18628d1385b256d7c3f4aa8 # inventory sha1: 5b4acb62c236d4882e72572d45d3925ab7b2dfd2 # parent ids: # pqm@pqm.ubuntu.com-20060622200147-08093baa0cf46599 # base id: pqm@pqm.ubuntu.com-20060622200147-08093baa0cf46599 # properties: # branch-nick: bzr.dev.one-shot