[Distutils] __init__.py getting left out of mpkg

jason pellerin jpellerin at gmail.com
Thu Mar 8 20:41:25 CET 2007


On 3/7/07, jason pellerin <jpellerin at gmail.com> wrote:
> On 3/7/07, Ian Bicking <ianb at colorstudy.com> wrote:
> > Phillip J. Eby wrote:
> > > At 02:29 PM 3/6/2007 -0500, jason pellerin wrote:
> > >> I've been meaning to ask about this same issue, specifically with
> > >> respect to namespace packages, bdist_rpm and imp. I've had to patch
> > >> the spec files for all namespace packages that we build as RPMs, since
> > >> although the .pth file works when using import or __import__, imp
> > >> doesn't seem to recognize it, and that breaks Paste's app loading.
> > >
> > > Then Paste's app loading is broken, and wouldn't work with an egg either,
> > > if it's using "imp" and ignoring the package's __path__.
> >
> > I'm not sure which part of Paste is in question, but the only importing
> > that I can think of which it does is with pkg_resources or with __import__.
>
> I didn't save the output from trying to use the broken package load,
> unfortunately. I'll try to recreate it if I can. I may easily be
> putting the blame in the wrong place, though, since the failure was in
> paste.modpython --

My apologies -- it's mod_python that fails, not Paste. I removed my
working Paste package (with the forced __init__.py) and reinstalled
the one without __init__.py. Here's the result:

Mod_python error: "PythonHandler paste.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
287, in HandlerDispatch
    log=debug)

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
461, in import_module
    f, p, d = imp.find_module(parts[i], path)

ImportError: No module named paste

So Paste is actually the victim, not the culprit. I don't know if
there's any way to work around this aside from building the package
with an __init__.py -- any ideas?

Thanks,

JP


More information about the Distutils-SIG mailing list