Title: Python Launcher can not recognize pyw file as Python GUI Script file type correctly.
Type: behavior Stage: patch review
Components: macOS Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: erlendaasland, gjj2828, ned.deily, ronaldoussoren
Priority: normal Keywords: patch

Created on 2019-04-03 06:27 by gjj2828, last changed 2020-02-29 08:07 by ronaldoussoren.

Pull Requests
URL Status Linked Edit
PR 12672 open gjj2828, 2019-04-03 09:18
Messages (4)
msg339380 - (view) Author: Jiongjiong Gao (gjj2828) * Date: 2019-04-03 06:27
In Python Launcher Preferences there are two settings for file type, Python Script and Python GUI Script. But Python Launcher can not recognize pyw file as Python GUI Script file type correctly.
msg362912 - (view) Author: Erlend Egeberg Aasland (erlendaasland) * Date: 2020-02-28 19:54
I might have missed something, but I thought .pyw files were a Windows specific thing.
msg362932 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-02-28 22:47
Thanks for the PR.

I believe there also used to be a distinction between .py and .pyw files back in the distant past of classic MacOS (9 and earlier) and limited support for .pyw was carried over into Mac OS X (10).  But most of the references to .pyw for macOS have been removed over the years other than, it seems, here in Python There are other more basic concerns with the Launcher app so I have been holding off on merging this change for 3.9.  I plan to make a decision about its fate by the end of the PyCon sprints in April.
msg362967 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-02-29 08:07
I'm fairly sure support for .pyw, or rather a separate python executable, was introduced in the MacOSX port. In particular, we started out with two different executables "python" and "pythonw" where the first was the regular python executable, while the second did the "launch executable in" dance to support GUI code from the command-line.  This was changed later on to always use the executable from

P.S. I still think Python Launcher is worrisome from a security standpoint (#5262).
Date User Action Args
2020-02-29 08:07:57ronaldoussorensetmessages: + msg362967
2020-02-28 22:47:05ned.deilysetmessages: + msg362932
2020-02-28 19:54:02erlendaaslandsetnosy: + erlendaasland
messages: + msg362912
2020-01-10 22:37:20cheryl.sabellasetversions: + Python 3.9, - Python 3.7
2019-04-03 09:18:15gjj2828setkeywords: + patch
stage: patch review
pull_requests: + pull_request12600
2019-04-03 06:27:07gjj2828create