classification
Title: Registry keys for Windows Store package have wrong executable
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: jkloth, miss-islington, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2019-07-31 16:20 by steve.dower, last changed 2019-08-17 20:51 by steve.dower. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15146 merged steve.dower, 2019-08-06 16:47
PR 15163 merged miss-islington, 2019-08-07 17:50
PR 15165 merged steve.dower, 2019-08-07 17:55
PR 15166 merged miss-islington, 2019-08-07 18:39
Messages (9)
msg348812 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-07-31 16:20
The next update to Windows will prevent launching executables from within the package install folder, and require you to launch from the user's local symlink to the executable (see issue37369).

Currently, the only value we can put into the registry when installing via the Store package points directly to the package install. There is no way to point at the local symlink.

I'm working with the Windows team to find either a fix or a workaround, but right now anyone who updates to preview Windows (or gets the update when it releases at the end of the year) will not be able to launch Python through tools that look in the registry.
msg348830 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-08-01 01:19
So far we've figured out that using the full installed path will work fine (by design) if you have enabled the matching alias. So essentially, if Python is on your PATH, you can also launch it using the full path.

I'm trying to convince them that it should only have to be installed for the current user. If they agree with that, we might get this fixed properly and then there's nothing to do here.
msg349112 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-08-06 16:26
It looks like the best solution here may be to rename the bundled executables to "python3.8.exe" etc. rather than "python.exe".

We will still keep the "python.exe" alias, and sys.executable won't change (it'll still point to the stable alias), but by having the "core" executable be named differently between Python versions it'll fix a couple of minor issues.

Most importantly here, because the registry path would then point at "python3.8.exe" rather than "python.exe", it becomes more likely that the global alias will remain enabled and so launching via the registry path will work. The downside is that apps that use "$InstallPath\python.exe" rather than "$ExecutablePath" will not work. But the ExecutablePath value has been present for a while now, and PEP 514 specifies it as preferred when available, so I think that's okay.

We can also include a plain "python[w].exe" in the installation, but that'll only be useful for subprocess.run("python") from the same version - it won't be executable at all from outside the app package.

(None of this affects the regular installer, FWIW. That'll still be plain "python.exe".)

Anyone have any thoughts or concerns?
msg349182 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-08-07 17:49
New changeset 1fab9cbfbaf19a7bc79cef382136fcf9491e3183 by Steve Dower in branch 'master':
bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146)
https://github.com/python/cpython/commit/1fab9cbfbaf19a7bc79cef382136fcf9491e3183
msg349187 - (view) Author: miss-islington (miss-islington) Date: 2019-08-07 18:07
New changeset eab76c3c75a572566862200728cc8d05b3298f12 by Miss Islington (bot) in branch '3.8':
bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146)
https://github.com/python/cpython/commit/eab76c3c75a572566862200728cc8d05b3298f12
msg349189 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-08-07 18:39
New changeset 0378d98678f3617fd44d9a6266e7c17ebce62755 by Steve Dower in branch 'master':
bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
https://github.com/python/cpython/commit/0378d98678f3617fd44d9a6266e7c17ebce62755
msg349190 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-08-07 18:48
Going to leave this open in commit review for now. I believe this will significantly improve the reliability, but depending on which Windows bugs people run into there may still be more things we can do.
msg349192 - (view) Author: miss-islington (miss-islington) Date: 2019-08-07 18:59
New changeset 84d31bbf1f7e10bde1ceadcfa0d83d30a04313d5 by Miss Islington (bot) in branch '3.8':
bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
https://github.com/python/cpython/commit/84d31bbf1f7e10bde1ceadcfa0d83d30a04313d5
msg349428 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-08-12 02:08
Here's an example of someone hitting this issue: https://stackoverflow.com/q/56974927
History
Date User Action Args
2019-08-17 20:51:12steve.dowersetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2019-08-12 02:08:08steve.dowersetmessages: + msg349428
2019-08-07 18:59:12miss-islingtonsetmessages: + msg349192
2019-08-07 18:48:53steve.dowersetmessages: + msg349190
stage: patch review -> commit review
2019-08-07 18:39:20miss-islingtonsetpull_requests: + pull_request14898
2019-08-07 18:39:18steve.dowersetmessages: + msg349189
2019-08-07 18:07:48miss-islingtonsetnosy: + miss-islington
messages: + msg349187
2019-08-07 17:55:09steve.dowersetpull_requests: + pull_request14897
2019-08-07 17:50:00miss-islingtonsetpull_requests: + pull_request14895
2019-08-07 17:49:46steve.dowersetmessages: + msg349182
2019-08-06 16:47:22steve.dowersetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request14882
2019-08-06 16:26:42steve.dowersetmessages: + msg349112
2019-08-01 01:19:37steve.dowersetmessages: + msg348830
2019-07-31 16:37:08jklothsetnosy: + jkloth
2019-07-31 16:20:02steve.dowercreate