[Distutils] SetupTools: Bug in launcher.c causing gui_scripts not to launch?

Alexander Michael lxander.m at gmail.com
Fri Dec 7 21:15:08 CET 2007


When installing a gui_script on WinXP I get the error:

Could not exec #!c:\Python24\pythonw.exe".

It looks like the shebang hasn't been stripped. In

http://svn.python.org/projects/sandbox/trunk/setuptools/launcher.c

(currently at r59407) should

    if (is_gui) {
        /* Use exec, we don't need to wait for the GUI to finish */
        execv(python, (const char * const *)(newargs));
        return fail("Could not exec %s", python);   /* shouldn't get here! */
    }

read something like:

    if (is_gui) {
        /* Use exec, we don't need to wait for the GUI to finish */
        execv(ptr, (const char * const *)(newargs));
        return fail("Could not exec %s", ptr);   /* shouldn't get here! */
    }

as in

    /* We *do* need to wait for a CLI to finish, so use spawn */
    return spawnv(P_WAIT, ptr, (const char * const *)(newargs));

so that the "#!" is stripped from the executable?

Thanks,
Alex


More information about the Distutils-SIG mailing list