[paramiko] closing SFTP connections

Robey Pointer robey at lag.net
Tue Jan 16 11:16:34 PST 2007


On 17 Dec 2006, at 15:03, Michael Gratton wrote:

> Robey Pointer wrote:
>
>> Since all Channel and SFTPClient objects belong to a single
>> Transport, if you close the Transport (or SSHClient), it should
>> automatically close all of its channels.  That will let you still
>> have only one "close()" call.
>
> Yep, but should the transport also automatically close once all  
> channels
> are closed? We are seeing this happen most times, but for something  
> like
> 1 in 20 connections, if all channels are closed (we're only opening  
> one
> per transport) the transport isn't closed.

It shouldn't ever happen.  You can close all channels but may still  
want to open another channel over the same transport, and that should  
work.

robey




More information about the paramiko mailing list