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 bstorm, ned.deily, paul.moore, steve.dower, tim.golden, vinay.sajip, vstinner, zach.ware
Date 2019-06-27.17:08:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561655326.56.0.712945465742.issue37369@roundup.psfhosted.org>
In-reply-to
Content
So I have a fix for 3.9 for this, I believe (involves making sys.base_executable configurable via PyConfig and overriding it and config->home when we know we're inside an app container).

For 3.8 I can apply the same fix and make sys.base_executable public, or keep it as sys._base_executable. Either way, it'll show up in PyConfig. (Victor - thoughts here? Should be a non-breaking change, right?)

For 3.7, I'm going to have to come up with a different fix, and possibly expose some new private API to be able to pass through the correct executable path.


Fundamentally, the problem is that Windows is going to start enforcing some ACLs that were previously not being enforced. In theory, when an application is deployed in an app package (as required through the Store), you are not supposed to be able to launch the executable directly. Instead, you should go through your current user's apps directory (C:\Users\name\AppData\Local\Microsoft\WindowsApps\<package family>, which contains only symlinks to the actual executables).

This has a very good advantage that the package family name does not change with new versions, while the full install path does. Currently, a behind-the-scenes update of Python will actually break environments when their "home" path is no longer correct.

However, it does mean that we need to start reporting a sys.executable that is not inside sys.prefix, and I'm not sure whether that is a good idea.

Looking at venv (+Vinay for confirmation here), it seems to treat "home" as "the directory containing the original Python binary" rather than "the directory containing the Python install". So in theory (and in my simple testing), using the sys.executable-not-in-prefix here is fine. But is that intentional?
History
Date User Action Args
2019-06-27 17:08:46steve.dowersetrecipients: + steve.dower, paul.moore, vinay.sajip, vstinner, tim.golden, ned.deily, zach.ware, bstorm
2019-06-27 17:08:46steve.dowersetmessageid: <1561655326.56.0.712945465742.issue37369@roundup.psfhosted.org>
2019-06-27 17:08:46steve.dowerlinkissue37369 messages
2019-06-27 17:08:46steve.dowercreate