Issue131

Title Shebang for gui_scripts on Windows is not changed to pythonw
Priority bug Status chatting
Superseder Nosy List flocki, pje
Assigned To Keywords

Created on 2011-08-04.10:56:19 by flocki, last changed 2011-08-04.18:20:31 by pje.

Files
File name Uploaded Type Edit Remove
issue131.patch flocki, 2011-08-04.11:04:31 text/plain
Messages
msg634 (view) Author: pje Date: 2011-08-04.18:20:31
Ah, so what you're saying is that this is a problem when creating a bdist_wininst, *while on Windows*.  Got it.  Thanks!
msg632 (view) Author: flocki Date: 2011-08-04.14:33:46
The problem is that the shebang of gui_scripts is not changed to #!pythonw.exe!

In my case new_header[2:-1] is "python.exe" (as set in get_script_header line 1420), thus os.path.exists(new_header[2:-1]) is false, and sys.platform!='win32' is false as well. hdr is never changed, and the gui script is started showing an ugly console
msg631 (view) Author: pje Date: 2011-08-04.14:14:31
So, under what input conditions does this produce a problem?  It seems like it would have to be one where the pythonw.exe doesn't exist, and one is installing on Windows.
msg630 (view) Author: flocki Date: 2011-08-04.10:56:19
When creating a wininst, get_script_header alwasy sets the executabe to "python.exe".

Thus, in get_script_args() the code to check if the header should actually be changed should be updated to:
if os.path.exists(new_header[2:-1]) or wininst or sys.platform!='win32':
    hdr = new_header
else:
    hdr = header
History
Date User Action Args
2011-08-04 18:20:31pjesetmessages: + msg634
2011-08-04 14:33:46flockisetmessages: + msg632
2011-08-04 14:14:31pjesetstatus: unread -> chatting
nosy: + pje
messages: + msg631
2011-08-04 11:04:31flockisetfiles: + issue131.patch
2011-08-04 10:56:19flockicreate