[Python-Dev] Add a -z interpreter flag to execute a zip file

Andy C andychup at gmail.com
Fri Jul 13 00:52:19 CEST 2007


On 7/12/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> > The patch suggests using .pyz and adding a default association to the
> > installer (much like .py and .pyw have).
>
> Ok. It would be good if the patch actually added that extension, rather
> than merely suggesting that it should be added.

So does everyone agree that there should be a new extension called
.pyz?  And that the definition of this is a .zip file with a
__zipmain__.py module at its root?  If so, I can make the change... I
haven't looked around the codebase yet but it sounds easy enough.

This makes it seem like a bigger change than it is, but I think it's
the right thing to do to support Windows properly.

Other points:

* I think it's true that the shebang line should only have one argument.

* Does anyone else want to change the -z flag to make more sense for
directories (and possibly change __zipmain__.py to __main__.py)?  In
thinking about this again, I am not sure I can come up with a real use
case.  I think it's sufficient to treat it as a documented "trick"
that you can substitute a whole directory for a zip file with the -z
flag.  If there is a concrete suggestion, I'd like to discuss it, but
otherwise it seems like we'll get bogged down in expanding use cases.

* Magically looking at the first argument to see if it's a zip file
seems problematic to me.  I'd rather be explicit with the -z flag.
Likewise, I'd rather be explicit and call it __zipmain__ rather than
__main__.

thanks,
Andy


More information about the Python-Dev mailing list