On 12 August 2013 16:35, Nick Coghlan <ncoghlan@gmail.com> wrote:
> Hm, here's a side thought: what if PyLauncher added the ability to
> serve as a script wrapper, just like setuptools' existing wrappers?
> Then setuptools could just copy py.exe or pyw.exe alongside a .pyl or
> .pyw, and presto!  No PATHEXT compatibility needed, but users could
> still opt out of using the .exe wrappers if they're sure their shell
> works right without it.
>
> (The wrapper facility would be implemented by simply checking for an
> adjacent file of matching filename and extension (.pyl for py.exe,
> .pyw for pyw.exe), and if found, insert that filename as argv[1]
> before proceeding with the normal launch process.  For efficiency, the
> file check could be skipped if the executable has its original name,
> at the minor cost of it not being possible to name a console script
> 'py' or a windows app 'pyw'.  But that's an optional tweak.)

This sounds like a plausible approach, especially if we add the
bootstrapping being considered for 3.4+ to PyLauncher for earlier
versions. (Donald has a draft PEP for that, he's just making a few
tweaks before publishing it for broader comment)


Do you want the time machine keys back? :-)

http://bugs.python.org/issue18491
Committed by Vinay in http://hg.python.org/cpython/rev/4123e002a1af

The wrapper source can be built that way if SCRIPT_WRAPPER is defined, but the build infrastructure does not currently define that. See the patch and issue log for details.

Paul