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

can not call simple commands #62

Open
madisvain opened this issue Aug 5, 2018 · 1 comment
Open

can not call simple commands #62

madisvain opened this issue Aug 5, 2018 · 1 comment

Comments

@madisvain
Copy link

madisvain commented Aug 5, 2018

The first example with calling time works perfectly. But when I try to do other simple things such as:

print(ssh.call(sys.version_info))

then the following exception is raised:

_pickle.PicklingError: Can't pickle <class 'sys.version_info'>: it's not the same object as sys.version_info

Also when getting a bit more complex:

print(ssh.call(subprocess.check_output, "apt-get update", shell=True).raise_failures())
Traceback (most recent call last):
  File "sticks.py", line 23, in <module>
    print(ssh.call(subprocess.check_output, "apt-get update", shell=True).raise_failures())
  File "/Users/konstruktor/.local/share/virtualenvs/shipit-WRCZ5US3/lib/python3.6/site-packages/chopsticks/tunnel.py", line 291, in call
    raise RemoteException(ret.msg)

I'm tunneling into a Ubuntu 18.04 machine. With SSHTunnel.

@rhizoome
Copy link

rhizoome commented Jun 26, 2020

You have to redirect stdout stdout=sys.stderr otherwise the output of the command will break the protocol.

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

2 participants