Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

channel.exit_status_ready() doesn't return True #1679

Open
Azteker opened this issue May 7, 2020 · 0 comments
Open

channel.exit_status_ready() doesn't return True #1679

Azteker opened this issue May 7, 2020 · 0 comments

Comments

@Azteker
Copy link

Azteker commented May 7, 2020

Here is how I open the ssh channel:

self.ssh_client = paramiko.SSHClient()

self.ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

self.ssh_client.connect(username=username, password=password, hostname=hostname, port=22, timeout=30, banner_timeout=30)

transport = self.ssh_client.get_transport()

self.channel = transport.open_session()

self.channel.get_pty(term='xterm', width=pty_width, height=pty_height)

self.channel.invoke_shell()

The problem is in the code of receiving data:

while not self.channel.exit_status_ready():

        data = self.channel.recv(1024).decode('utf-8')

The while loop never ends when the ssh is on, the channel is in blocking mode. The process has finished. But exit_status_ready() never returns a True, so it blocks at channel.recv(). What is wrong ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant