mwilliamson / spur.py

Run commands and manipulate files locally or over SSH using the same interface
BSD 2-Clause "Simplified" License
267 stars 37 forks source link

SSH Shell stuck in infinite while loop #33

Closed karthiksrinivasan closed 9 years ago

karthiksrinivasan commented 9 years ago

Hi William,

I am having some odd issue where the code gets stuck in a infinite loop within _read_int_initialization_line(). I tried step through the program and it seems like variable line seems to empty all the time.

Sample Code:

with spur.LocalShell() as shell:
        result = shell.run(["echo", "hello"])
        print (result.output)
with spur.SshShell("*********", username="karthiks", password="********") as shell:
        result = shell.run(["echo 'hello'"])
        print (result.output)

The local shell works as expected, whereas the ssh shell gets stuck in infinite loop, any help is appreciated.

Thanks, Karthik

karthiksrinivasan commented 9 years ago

I created a SshShell with shell_type=spur.ssh.ShellTypes.minimal and it seems to have fixed the issue. Although, not sure what caused the error in previous case, time to do some digging.

Apologies for wasting your time.

Thanks, Karthik

mwilliamson commented 9 years ago

No worries, glad to hear you got it sorted.