TypeError: execv() arg 2 must contain only strings

前端 未结 2 1705
故里飘歌
故里飘歌 2021-01-04 00:23

I am getting the following error when running the script below,can anyhelp to identify what the problem is and how to overcome it

import subprocess
import sy         


        
2条回答
  •  失恋的感觉
    2021-01-04 00:48

    The third element in ssh_command is an integer. It needs to be a string.

    e.g:

    ssh_command = ["ssh", "-p", 29418, ...
    #                            ^ problem
    

    And the solution is simple, just add some quotes:

    ssh_command = ["ssh", "-p", "29418", ...
    #                           ^Now it's a string.
    

提交回复
热议问题