summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2006-09-11 10:56:04 -0700
committerRobey Pointer <robey@lag.net>2006-09-11 10:56:04 -0700
commit31c26eafb90f245ea0d2baf60a5a573b362d901e (patch)
treec2b8492dcb938db7acd3a22c9abf75fb3efbefc2
parent4acb9589ced5a05d9f52f7fcb0f3f8630cb37c71 (diff)
[project @ robey@lag.net-20060911175604-bf2798fcebd62780]
trap EOF errors when reading a response, and translate into SSHException
-rw-r--r--paramiko/sftp_client.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index 6fa1cd93..9a1ecfdc 100644
--- a/paramiko/sftp_client.py
+++ b/paramiko/sftp_client.py
@@ -598,7 +598,10 @@ class SFTPClient (BaseSFTP):
def _read_response(self, waitfor=None):
while True:
- t, data = self._read_packet()
+ try:
+ t, data = self._read_packet()
+ except EOFError, e:
+ raise SSHException('Server connection dropped: %s' % (str(e),))
msg = Message(data)
num = msg.get_int()
if num not in self._expecting: