Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry keys for Windows Store package have wrong executable #81915

Closed
zooba opened this issue Jul 31, 2019 · 9 comments
Closed

Registry keys for Windows Store package have wrong executable #81915

zooba opened this issue Jul 31, 2019 · 9 comments
Assignees
Labels
3.8 (EOL) end of life 3.9 only security fixes OS-windows type-bug An unexpected behavior, bug, or error

Comments

@zooba
Copy link
Member

zooba commented Jul 31, 2019

BPO 37734
Nosy @pfmoore, @tjguk, @jkloth, @zware, @zooba, @miss-islington
PRs
  • bpo-37734: Fix use of registry values to launch Python from Microsoft Store app #15146
  • [3.8] bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146) #15163
  • bpo-37734: Remove unnecessary brace escapes in PC/layout script #15165
  • [3.8] bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165) #15166
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2019-08-17.20:51:12.883>
    created_at = <Date 2019-07-31.16:20:01.986>
    labels = ['type-bug', '3.8', '3.9', 'OS-windows']
    title = 'Registry keys for Windows Store package have wrong executable'
    updated_at = <Date 2019-08-17.20:51:12.882>
    user = 'https://github.com/zooba'

    bugs.python.org fields:

    activity = <Date 2019-08-17.20:51:12.882>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2019-08-17.20:51:12.883>
    closer = 'steve.dower'
    components = ['Windows']
    creation = <Date 2019-07-31.16:20:01.986>
    creator = 'steve.dower'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37734
    keywords = ['patch']
    message_count = 9.0
    messages = ['348812', '348830', '349112', '349182', '349187', '349189', '349190', '349192', '349428']
    nosy_count = 6.0
    nosy_names = ['paul.moore', 'tim.golden', 'jkloth', 'zach.ware', 'steve.dower', 'miss-islington']
    pr_nums = ['15146', '15163', '15165', '15166']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37734'
    versions = ['Python 3.8', 'Python 3.9']

    @zooba
    Copy link
    Member Author

    zooba commented Jul 31, 2019

    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 bpo-37369).

    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.

    @zooba zooba added 3.8 (EOL) end of life 3.9 only security fixes labels Jul 31, 2019
    @zooba zooba self-assigned this Jul 31, 2019
    @zooba zooba added OS-windows type-bug An unexpected behavior, bug, or error labels Jul 31, 2019
    @zooba
    Copy link
    Member Author

    zooba commented Aug 1, 2019

    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.

    @zooba
    Copy link
    Member Author

    zooba commented Aug 6, 2019

    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?

    @zooba
    Copy link
    Member Author

    zooba commented Aug 7, 2019

    New changeset 1fab9cb by Steve Dower in branch 'master':
    bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146)
    1fab9cb

    @miss-islington
    Copy link
    Contributor

    New changeset eab76c3 by Miss Islington (bot) in branch '3.8':
    bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146)
    eab76c3

    @zooba
    Copy link
    Member Author

    zooba commented Aug 7, 2019

    New changeset 0378d98 by Steve Dower in branch 'master':
    bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
    0378d98

    @zooba
    Copy link
    Member Author

    zooba commented Aug 7, 2019

    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.

    @miss-islington
    Copy link
    Contributor

    New changeset 84d31bb by Miss Islington (bot) in branch '3.8':
    bpo-37734: Remove unnecessary brace escapes in PC/layout script (GH-15165)
    84d31bb

    @zooba
    Copy link
    Member Author

    zooba commented Aug 12, 2019

    Here's an example of someone hitting this issue: https://stackoverflow.com/q/56974927

    @zooba zooba closed this as completed Aug 17, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 (EOL) end of life 3.9 only security fixes OS-windows type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants