This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Alexander.Todorov, dstufft, eric.araujo, eryksun
Date 2020-10-07.11:00:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602068444.2.0.404197988823.issue41965@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-10-07 11:00:44eryksunsetrecipients: + eryksun, eric.araujo, dstufft, Alexander.Todorov
2020-10-07 11:00:44eryksunsetmessageid: <1602068444.2.0.404197988823.issue41965@roundup.psfhosted.org>
2020-10-07 11:00:44eryksunlinkissue41965 messages
2020-10-07 11:00:43eryksuncreate