ssh keepalive

Lie Ryan lie.1296 at gmail.com
Wed Oct 1 04:07:43 EDT 2008


On Wed, 01 Oct 2008 00:30:59 -0700, loial wrote:

> I have a problem with a ssh connection in python
> 
> I get the error
> 
> 'NoneType' object has no attribute 'exec_command'
> 
> I am thinking that maybe the ssh connection is timeing out.
> 
> Since I have no control over the configuration of the ssh server(which
> is AIX 5.23), is there anything I can do in python to ensure that the
> ssh session does not timeout?

No, it's a NoneType object (i.e. your variable contains None)
Show us a bit of your code, so we can see why is None there.

My guess is that you're trying to perform something on a function that 
does things in-place and doesn't return anything (e.g. list.append, 
list.sort)

>>> a = [1, 3, 4, 2]
>>> a = a.sort()
>>> print a
[None, None, None, None]

>>> # should be
>>> a = [1, 3, 4, 2]
>>> a.sort()
>>> print a
[1, 2, 3, 4]




More information about the Python-list mailing list