Eryk Sun <eryk...@gmail.com> added the comment:
The linked code runs subprocess.check_output([rstbin, path]), which won't work with "rst2man.py" in Windows. Reliably running a .py script in Windows requires running it explicitly via py[w].exe or python[w].exe, or via sys.executable from an existing Python process. subprocess.Popen calls WinAPI CreateProcessW, which supports PE executables, and also CMD/BAT scripts via %ComSpec%. With shell=True the command is run via `cmd.exe /c`, which tries ShellExecuteExW in order to execute the file using the filetype's default registered action. However, the default action for .py files isn't dependable. It's often configured to open the script in an editor or IDE. Thus script entrypoints in Windows get installed as wrapped launchers, e.g. "script.exe" instead of "script.py". The launcher executes the embedded entrypoint script via the fully-qualified path of python.exe. ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41965> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com