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 steve.dower
Recipients eric.smith, eryksun, paul.moore, steve.dower, tim.golden, uranusjr, zach.ware
Date 2019-11-26.17:31:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574789497.11.0.0779021545947.issue38905@roundup.psfhosted.org>
In-reply-to
Content
> But then I need two separate workflows based on what is passed in. For py.exe I need to run it and get sys.executable. But for python.exe I *cannot* use sys.executable because that’s the base interepeter, not the venv path I want. And `if Path(arg).stem == "py"` just seems like a bug waiting to happen.

If you use shutil.which() to resolve "python" or "py" against PATH (which doesn't include the application directory), then you'll get the full path to the correct python.exe and will get the expected sys.executable. So it's only one flow that works for both once you add the shutil.which step.
History
Date User Action Args
2019-11-26 17:31:37steve.dowersetrecipients: + steve.dower, paul.moore, eric.smith, tim.golden, zach.ware, eryksun, uranusjr
2019-11-26 17:31:37steve.dowersetmessageid: <1574789497.11.0.0779021545947.issue38905@roundup.psfhosted.org>
2019-11-26 17:31:37steve.dowerlinkissue38905 messages
2019-11-26 17:31:36steve.dowercreate