[Python-Dev] Inconsistent behaviour in import/zipimport hooks
Paul Moore
p.f.moore at gmail.com
Thu Nov 10 11:23:48 CET 2005
On 11/10/05, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Paul Moore wrote:
> > On 11/9/05, Bob Ippolito <bob at redivi.com> wrote:
> >> On Nov 9, 2005, at 1:48 PM, Thomas Heller wrote:
> >>
> >>> Bob Ippolito <bob at redivi.com> writes:
> >>>
> >>>> On Nov 9, 2005, at 1:22 PM, Bill Janssen wrote:
> >>>>
> >>>>> It's a shame that
> >>>>>
> >>>>> 1) there's no equivalent of "java -jar", i.e., "python -z
> >>>>> FILE.ZIP", and
> >>>> This should work on a few platforms:
> >>>> env PYTHONPATH=FILE.zip python -m some_module_in_the_zip
> >>> It should, yes - but it doesn't: -m doesn't work with zipimport.
> >> That's dumb, someone should fix that. Is there a bug filed?
> >
> > I did, a while ago. http://www.python.org/sf/1250389
>
> Please consider looking at and commenting on PEP 328 - I got zero feedback
> when I wrote it, and basically assumed no-one else was bothered by the -m
> switch's fairly significant limitations (it went in close to the first Python
> 2.4 alpha release, so we wanted to keep it simple).
>
> The PEP and the associated patch currently only cover lifting the limitation
> against executing modules inside packages, but it should be possible to extend
> it to cover executing modules inside zip files as well (as you say, increasing
> use of eggs will only make the current limitations more annoying).
>
> That discussion should probably happen on c.l.p, though. cc' me if you start
> one, and I can keep on eye on it through Google (I won't have time to
> participate actively, unfortunately :()
I didn't respond simply because it seemed obvious that this should go
in, and I expected no debate. I assumed the only reason it didn't go
into 2.4 was because the issue came up too close to the release. Teach
me to assume, I guess...
FWIW, I'm +1 on PEP 338.
Paul.
More information about the Python-Dev
mailing list