[Distutils] How to handle launcher script importability?

Paul Moore p.f.moore at gmail.com
Wed Aug 14 15:48:47 CEST 2013

On 14 August 2013 12:42, Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:

> > I do think, as I said before, that this needs some sort of policy-type
> PEP on the standard approach for wrapping scripts, with all the pros and
> cons of the various approaches documented and reviewed.
> There have been so many emails on this list that I can't immediately
> find it but somewhere Steve Dower of Microsoft said something like:
> '''
>     Don't worry. Exe wrappers are *definitely* the best solution for this.
> '''
> (quote is approximate and emphasis added by me).
> My experience has lead me to the same conclusion as Steve. It may be
> worth documenting the reasons why but make no mistake about it: .exe
> wrappers of some form are the way to go.

I would like it documented, with all the reasons, so that we don't keep
rehashing this whole thing over and over.

Also, if we do recommend exes, I'd like to see something (in the stdlib
ultimately) that makes it trivially easy to "wrap" an existing .py script
(a standalone one, not one with an associated setup.py) into an exe. Having
two ways to write a command using Python is icky. Also, I'd like a
single-file solution. More times than I care to remember I have put a
program on a USB key or in my dropbox/skydrive and forgotten the "support
stuff" (whether that's required DLLs, resource files, or whatever - it's
not a Python-specific problem).

But I do see your point regarding things like subprocess. It's a shame, but
anything other than exes do seem to be second class citizens on Windows.
BTW, you mention bat files - it bugs me endlessly that bat files seem to
have a more privileged status than "other" script formats whether that's
.py or .ps1 or whatever. I've never managed to 100% convince myself that
they are special in a way that you can't replicate with suitable settings
(PATHEXT, etc, etc). I think it's that .bat is hard-coded in the OS search
algorithm or something, though. The docs are not easy to locate on the
various aspects of matter. (If bat files didn't have their horrible nesting
and ctrl-C handling behaviours, they'd be a viable solution...)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130814/ef65ad9d/attachment-0001.html>

More information about the Distutils-SIG mailing list