Title: Fix file association MIME type on Windows
Type: behavior Stage: needs patch
Components: Windows Versions: Python 3.9, Python 3.8, Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: mhammond, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2020-02-14 08:49 by steve.dower, last changed 2020-02-14 11:44 by mhammond.

Messages (2)
msg361989 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-02-14 08:49
The installer for Windows creates file associations in Tools/msi/launcher/launcher_reg.wxs that identify ".py[w]" files as text/plain.

This is inconsistent with the mimetypes module, which uses text/x-python, and may cause some applications to assume that calling ShellExecute on a .py file will open a text editor rather than executing the script.

We should update the MIME type to text/x-python. This can be backported, as the change is in the launcher and isn't tied to the usual upgrade paths anyway.
msg361990 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-02-14 08:51
The most likely negative potential impact of this would be for any users who have added additional verbs based on the content type. I don't recall whether we set PerceivedType or not, but that can probably stay.

I'm not aware of any applications (besides Windows itself) that set verbs based on content type rather than extensions, so I doubt anyone will be too upset.
Date User Action Args
2020-02-14 11:44:39mhammondsetnosy: + mhammond
2020-02-14 08:51:42steve.dowersetmessages: + msg361990
2020-02-14 08:49:42steve.dowercreate