List Info

Thread: Add a -z interpreter flag to execute a zip file




Re: Add a -z interpreter flag to execute a zip file
user name
2007-07-23 22:00:28
New icons get added so rarely that each time it happens,
Windows has
changed enough to make the instructions invalid... I do
remember
creating icon associations for .py, .pyc, .pyo and .pyw, and
separate
"open" associations for these. IIRC the two
associations are quite
independent. Probably everything has changed though since we
now use
MSI.

--Guido

On 7/23/07, Andy C <andychupgmail.com> wrote:
> Just to update everyone on the status of this, the next
thing on my
> list is to figure out the Windows build and set up the
the file
> association in the installer.  Actually, I should ask
if there's
> anything else that I should pay attention to here, e.g.
do I have to
> add an icon association for Windows or something like
that?
>
> Is there any documentation like a wiki page on this?  I
looked at the
> README in the PC* directories and it doesn't seem to
talk about the
> installer.  Maybe it will become clearer when I get
Visual Studio.
>
> Andy
>
> On 7/23/07, Paul Moore <p.f.mooregmail.com> wrote:
> > On 23/07/07, Phillip J. Eby <pjetelecommunity.com> wrote:
> > > Actually, it isn't, because you can't start a
zipfile with a Python
> > > script.  Lord knows I've *tried*, but the
Python interpreter just
> > > won't accept arbitrary binary data as part of
a script.  
> >
> > That bit me a while back, hard enough that I
thought of putting
> > together a patch for it (probably just to stop
processing the script
> > at a NUL byte), but never did as I didn't think I
could put a
> > convincing enough case for it being *useful*.
> >
> > Anyway, I'd be happy enough with the -z patch as
it stands, or if
> > someone comes up with something better, that would
suit me too...
> >
> > Paul.
> > _______________________________________________
> > Python-Dev mailing list
> > Python-Devpython.org
> > ht
tp://mail.python.org/mailman/listinfo/python-dev
> > Unsubscribe: http://mail.python.org/mailman/options/pyt
hon-dev/andychup%40gmail.com
> >
>


-- 
--Guido van Rossum (home page: http://www.python.org/~
guido/)
_______________________________________________
Python-Dev mailing list
Python-Devpython.org
ht
tp://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/p
ython-dev/nessto%40sharedlog.com

Re: Add a -z interpreter flag to execute a zip file
user name
2007-07-24 12:28:46
On 7/24/07, David Gowers <00ai99gmail.com> wrote:
> On 7/24/07, Guido van Rossum <guidopython.org> wrote:
> > On 7/12/07, Daniel Stutzbach <danielstutzbachenterprises.com> wrote:
> > > On 7/11/07, Andy C <andychupgmail.com> wrote:
> > > > The good thing about this is that it's
extremely simple -- basically
> > > > 20 lines of C code to add a -z flag that
calls a 3-line Python
> > > > function in the runpy module.
> > >
> > > Instead of requiring a -z flag, why not have
the interpreter peak at
> > > the file to see if it starts with one of the
ZIP magic numbers?
> > >
> > > That way it Just Works.
> >
> > I guess you wouldn't recognize a zip file if it
hits you in the face.
> > Literally. 
> >
> > Zip files don't start with a magic number.
>
> ZIP files *do* start with a magic number; either
PK34 (non-empty
> archive) or PK56 (empty archive). This is rather
easy to notice,
> as I did in the bad old days of DOS, and i recently
doubly verified it
> ('zip'+'khexedit', and
> h
ttp://en.wikipedia.org/wiki/ZIP_%28file_format%29; I
tried the
> infozip website too, but it seems to be down.)

You can believe that, but it's not the whole story. You can
*prepend*
arbitrary data and the zip tools can still read the
archive.

-- 
--Guido van Rossum (home page: http://www.python.org/~
guido/)
_______________________________________________
Python-Dev mailing list
Python-Devpython.org
ht
tp://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/p
ython-dev/nessto%40sharedlog.com

[1-10] [11-20] [21-30] [31-40] [41-42]

about | contact  Other archives ( Real Estate discussion Medical topics )