classification
Title: Windows installer assigns non-existent icons to Python file types
Type: behavior Stage: resolved
Components: Installation, Windows Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: bwanamarko, paul.moore, python-dev, steve.dower, thijsvandien, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2015-09-14 18:02 by thijsvandien, last changed 2015-09-23 01:22 by steve.dower. This issue is now closed.

Files
File name Uploaded Description Edit
Screen Shot 2015-09-14 at 20.00.50.png thijsvandien, 2015-09-14 18:02 Screenshot of associations made, why they don't work and the result
25112_1.patch steve.dower, 2015-09-14 18:41
Messages (7)
msg250696 - (view) Author: Thijs van Dien (thijsvandien) Date: 2015-09-14 18:02
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.
msg250699 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-09-14 18:41
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.
msg250761 - (view) Author: Thijs van Dien (thijsvandien) Date: 2015-09-15 12:18
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.
msg250765 - (view) Author: Thijs van Dien (thijsvandien) Date: 2015-09-15 12:35
On the other hand, if the launcher is somehow strictly necessary, then why is it optional?
msg251053 - (view) Author: Mark Mikofski (bwanamarko) Date: 2015-09-19 06:02
+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
msg251356 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2015-09-22 22:17
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.
msg251386 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-23 01:21
New changeset 4d0d987bf6a8 by Steve Dower in branch '3.5':
Issues #25112: py.exe launcher is missing icons
https://hg.python.org/cpython/rev/4d0d987bf6a8
History
Date User Action Args
2015-09-23 01:22:02steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-09-23 01:21:42python-devsetnosy: + python-dev
messages: + msg251386
2015-09-22 22:17:50steve.dowersetmessages: + msg251356
2015-09-19 06:02:56bwanamarkosetnosy: + bwanamarko
messages: + msg251053
2015-09-15 12:35:25thijsvandiensetmessages: + msg250765
2015-09-15 12:18:36thijsvandiensetmessages: + msg250761
2015-09-14 18:41:17steve.dowersetfiles: + 25112_1.patch
messages: + msg250699

assignee: steve.dower
keywords: + patch
stage: patch review
2015-09-14 18:02:05thijsvandiencreate