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

remote ssh on windows server can't execute python #946

Open
ThetaGHun opened this issue Mar 24, 2019 · 6 comments
Open

remote ssh on windows server can't execute python #946

ThetaGHun opened this issue Mar 24, 2019 · 6 comments

Comments

@ThetaGHun
Copy link

when I configured my remote connection to Win2016 server and trying to activate it this message comes up:

Failed to execute Python (“C:\Python2\python.exe) on the SSH server
ReturnCode: 1
Output:
ErrorOutput: File ’, line 1
import

SyntaxError EOL while scanning string literal

@ThetaGHun
Copy link
Author

P.S.: with Linux server opening the SSH for debugging works, but not with Windows server OpenSSH installed.

@ThetaGHun
Copy link
Author

ThetaGHun commented Mar 24, 2019

I figured out what the issue is: in cPySSHDebugger.pas line 114 you use this

'''import sys,os,tempfile;print(sys.version[0]);print(os.sep);print(tempfile.gettempdir())'''

However, it should this I guess:

'"import sys,os,tempfile;print(sys.version[0]);print(os.sep);print(tempfile.gettempdir())"'

It has " (one double mark) instead of '' (double single marks).

Because then I did run:
python -c 'import sys,os,tempfile;print(sys.version[0]);print(os.sep);print(tempfile.gettempdir())'

I got this back:

File "", line 1
'import
^
SyntaxError: EOL while scanning string literal

See, the same error !

But when I did run this way:

python -c "import sys,os,tempfile;print(sys.version[0]);print(os.sep);print(tempfile.gettempdir())"

It all worked as expected.

@ThetaGHun
Copy link
Author

Finally, I did compile it and found a temporary solution (run a remote init.py file instead of using "python -c"). But that is only a temporary solution.

(FYI, I didn't worked in Delphi for almost 25 years.)

@pyscripter
Copy link
Owner

pyscripter commented Mar 25, 2019

Thanks for the bug report. I will have a closer look. But SSHing to Windows machine did work here. Are you using a recent version of OpenSSH from https://github.com/PowerShell/Win32-OpenSSH/releases on both sides?

You may also try putty (see https://pyscripter.blogspot.com/2019/01/ssh-engines-using-putty.html). I know it is being used a lot with success.

@ThetaGHun
Copy link
Author

I use Win64 version OpenSSH on Win server side and I have Putty on my notebook.

If you want it, I can grant you temporary access to my VPS. So, you can take a closer look.
(I know how hard it would be to debug if you have an other config.)

@pyscripter
Copy link
Owner

But which version of ssh? e.g.

C:>ssh -V
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

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