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

Andy C andychup at gmail.com
Fri Jul 13 06:26:19 CEST 2007


Another issue I see is that -m and -c have command line parsing
semantics, and -z follows those now.

python -z foo.zip -z bar

As implemented, this would pass sys.argv[0:3] == ['foo.zip', '-z', 'bar']

If you allow multiple -z flags to be meaningful, this gets confusing.
The foo.zip program could have a legitimate -z flag.

If you overload -z to mean "prepend things to sys.path", then you
might also want to do python -z /dir1 -z /foo.zip -c 'import foo;
print foo'.  Should this execute dir1/__main__.py, foo.zip/__main__.py
or print foo?

I could be missing what you intend.  But I think the patch as
implemented doesn't have any of these potentially unconsidered cases
and unintended consequences.

Andy


More information about the Python-Dev mailing list