[Tutor] run local script on a remote machine

Alex Kleider akleider at sonic.net
Thu Oct 27 12:37:23 EDT 2016


On 2016-10-27 00:57, Wolfgang Maier wrote:
> 
> The structure of the command you are trying to execute would require
> you to set the "shell" argument of subprocess.call to True.
> Specifically, the "<" redirection operator is shell functionality.

Thank you Wolfgang.  Simply eliminating the call to shlex.split() made 
everything work as desired.

.........

> 
> as long as you promise to NEVER use that code in production with user
> input. The problem with it is that it may allow users to inject shell
> commands as they like exactly because whatever ends up in the command
> string gets interpreted by the shell.

I promise!

Thanks again.
Alex


_____________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list