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

Windows installer assigns non-existent icons to Python file types #69299

Closed
thijsvandien mannequin opened this issue Sep 14, 2015 · 7 comments
Closed

Windows installer assigns non-existent icons to Python file types #69299

thijsvandien mannequin opened this issue Sep 14, 2015 · 7 comments
Assignees
Labels
OS-windows topic-installation type-bug An unexpected behavior, bug, or error

Comments

@thijsvandien
Copy link
Mannequin

thijsvandien mannequin commented Sep 14, 2015

BPO 25112
Nosy @pfmoore, @tjguk, @zware, @zooba, @mikofski
Files
  • Screen Shot 2015-09-14 at 20.00.50.png: Screenshot of associations made, why they don't work and the result
  • 25112_1.patch
  • 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 2015-09-23.01:22:02.989>
    created_at = <Date 2015-09-14.18:02:05.020>
    labels = ['type-bug', 'expert-installation', 'OS-windows']
    title = 'Windows installer assigns non-existent icons to Python file types'
    updated_at = <Date 2015-09-23.01:22:02.988>
    user = 'https://bugs.python.org/thijsvandien'

    bugs.python.org fields:

    activity = <Date 2015-09-23.01:22:02.988>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2015-09-23.01:22:02.989>
    closer = 'steve.dower'
    components = ['Installation', 'Windows']
    creation = <Date 2015-09-14.18:02:05.020>
    creator = 'thijsvandien'
    dependencies = []
    files = ['40464', '40465']
    hgrepos = []
    issue_num = 25112
    keywords = ['patch']
    message_count = 7.0
    messages = ['250696', '250699', '250761', '250765', '251053', '251356', '251386']
    nosy_count = 7.0
    nosy_names = ['paul.moore', 'tim.golden', 'python-dev', 'zach.ware', 'steve.dower', 'bwanamarko', 'thijsvandien']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue25112'
    versions = ['Python 3.5']

    @thijsvandien
    Copy link
    Mannequin Author

    thijsvandien mannequin commented Sep 14, 2015

    Whenever the Python launcher is selected, the installer sets the icon for common Python file extensions, i.e. .py, .pyc, .pyo, .pyw, .pyz and .pyzw. Formerly (under Python 3.4) the icons were located in DLLs in the Python installation directory. The new installer assigns either py.exe,1 or py.exe,2 as the icon. Because py.exe contains just a single icon, the only valid icon index is 0. As a result of the invalid icon, all Python files show up with either blank or generic icons. Probably those icons have not been included as they should have.

    Tested on Windows 7 SP1, both X86 and AMD64, both fresh a fresh install and one with quite a bit of history. It occurs with all appropriate Python 3.5 installers (pick any of X86/AMD64 and web/non-web). Make sure the Python launcher is selected; the default settings will do.

    @thijsvandien thijsvandien mannequin added topic-installation OS-windows type-bug An unexpected behavior, bug, or error labels Sep 14, 2015
    @zooba
    Copy link
    Member

    zooba commented Sep 14, 2015

    That is indeed what happened. The resource file for the launcher was not updated (or the update got lost... I was fairly sure I did it)

    Attached patch fixes it.

    @zooba zooba self-assigned this Sep 14, 2015
    @thijsvandien
    Copy link
    Mannequin Author

    thijsvandien mannequin commented Sep 15, 2015

    Thanks for the update. I'm not sure why the proper assignment of icons now depends on the installation of the Python launcher (py.exe). The icons are installed in the DLLs directory just like before. Perhaps I'm not familiar enough with the purpose of the launcher, but it seems to me that python.exe and pythonw.exe are enough to do something with Python files. Therefore, in my opinion, Python files should always be associated with Python and get the proper icons, regardless of the presence of the Python launcher. You may consider this a secondary issue, in which case I'd gladly open another ticket.

    @thijsvandien
    Copy link
    Mannequin Author

    thijsvandien mannequin commented Sep 15, 2015

    On the other hand, if the launcher is somehow strictly necessary, then why is it optional?

    @mikofski
    Copy link
    Mannequin

    mikofski mannequin commented Sep 19, 2015

    +1 I just wasted at least an hour on this. :( should have checked bugs first. Google says nothing, so I thought I was going crazy. I saw that py.exe had only one icon and that Python.File had c:\windows\py.exe, 1 while Python.CompiledFile had C:\windows\py.exe, 2, so I thought that might be it, but I just wasn't sure.

    Are the Py2 and Py3 icons exactly the same? if so, then IMO just use the py.ico and pyc.ico icons in the DLLs folder as suggested

    @zooba
    Copy link
    Member

    zooba commented Sep 22, 2015

    The file associations are actually part of the launcher, which *technically* is independent of the Python install it is bundled with. So it doesn't have any references to the Python install directory, and double-clicking Python files with shebang lines will work properly.

    For 3.5.1 I'm considering making the launcher an independent uninstall item (in response to another issue), so if you install 3.5.1 and then remove it, you can keep the launcher. For this to work, it has to be independent of the main install, so it can't refer to the DLLs directory.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 23, 2015

    New changeset 4d0d987bf6a8 by Steve Dower in branch '3.5':
    Issues bpo-25112: py.exe launcher is missing icons
    https://hg.python.org/cpython/rev/4d0d987bf6a8

    @zooba zooba closed this as completed Sep 23, 2015
    @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
    OS-windows topic-installation type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant