[Distutils] __init__.py getting left out of mpkg

jason pellerin jpellerin at gmail.com
Fri Mar 9 00:21:07 CET 2007


On 3/8/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 02:41 PM 3/8/2007 -0500, jason pellerin wrote:
> >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?
>
> Fix mod_python/apache.py to use __import__ instead of imp, perhaps?

I don't think that's very likely. ;) They are using imp (and seem to
be using it properly, based on what you wrote earlier about using the
package path as the path for dotted lookups) for the same reason I use
it in nose -- to load foo/bar.py and baz/bar.py as different modules
(where foo and baz are non-package directories). imp gives you enough
control to do that, but __import__ doesn't, as far as I know.

JP


More information about the Distutils-SIG mailing list