On Sat, Apr 4, 2020 at 3:41 PM Brian Theado <[email protected]> wrote:

I've never used this command before and I just tried it and I get a similar
> error.
>
>
> https://github.com/leo-editor/leo-editor/commit/016867f5ade5da6796397ab4705287bf8b8f336a
>  -
> this is the commit which fixed #1425 for Windows by using subprocess.Popen
> instead of os.system.
>
> The documentation for subprocess.Popen looks complicated:
> https://docs.python.org/3/library/subprocess.html and it looks like the
> behavior is different for windows and Posix.
>
> "args should be a sequence of program arguments or else a single string or
> path-like object. By default, the program to execute is the first item in
> args if args is a sequence. *If args is a string, the interpretation is
> platform-dependent and described below*"
>
> and
>
> "*Unless otherwise stated, it is recommended to pass args as a sequence*"
>
> So maybe passing as a list rather than string will work for both
> platforms. Instead of this:
>
> command = f'{g.sys.executable} {g.app.loadDir}/runLeo.py "{fn}"'
>
>
> this
>
> command = [g.sys.executable, f"{g.app.loadDir}/runLeo.py", fn]
>
>
Many thanks, Brian, for this sleuthing. I've just created #1564
<https://github.com/leo-editor/leo-editor/issues/1564> for this.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2T1eEztYBYmg_k92s_vvmpUFv6%2BxQjK3z9Z3_2D2kVaQ%40mail.gmail.com.

Reply via email to