ParallelSSH / ssh2-python

Python bindings for libssh2 C library.
https://parallel-ssh.org
GNU Lesser General Public License v2.1
228 stars 70 forks source link

Unknown error while starting the session #172

Closed tuxmaster5000 closed 2 years ago

tuxmaster5000 commented 2 years ago

Sample code:

 connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 connection.settimeout(2)
 try:
   connection.connect((host.host_name, 22))
   except socket.error as e:
   self._logger.warning("Unable connect to {0}. {1}".format(host.host_name, e))
   ...
 session = Session()
 session.handshake(connection)

It will fails with: File "ssh2/session.pyx", line 84, in ssh2.session.Session.handshake File "ssh2/utils.pyx", line 191, in ssh2.utils.handle_error_codes ssh2.exceptions.UnknownError: ('Error code %s not known', -5)

Version: 0.15.0

tuxmaster5000 commented 2 years ago

Version 0.27.0 fix it