diff options
Diffstat (limited to 'paramiko/sftp_file.py')
-rw-r--r-- | paramiko/sftp_file.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py index c173d1c8..36d6772f 100644 --- a/paramiko/sftp_file.py +++ b/paramiko/sftp_file.py @@ -43,7 +43,14 @@ class SFTPFile (BufferedFile): def close(self): BufferedFile.close(self) - self.sftp._request(CMD_CLOSE, self.handle) + try: + self.sftp._request(CMD_CLOSE, self.handle) + except EOFError: + # may have outlived the Transport connection + pass + except IOError: + # may have outlived the Transport connection + pass def _read(self, size): size = min(size, self.MAX_REQUEST_SIZE) |