Dag-Erling Sm?rgrav wrote, On 14-03-2007 13:16:
> AttributeError: 'module' object has no attribute 'auth'
> The following one-line fix seems to solve the problem for me:
> --- subsystem/webFront/lib/nav/web/auth.py.orig Tue Mar 13 11:59:25 2007
> +++ subsystem/webFront/lib/nav/web/auth.py Wed Mar 14 12:09:35 2007
> However, I wouldn't expect a bug like this to slip into a release, so
> I have to wonder if something else is wrong - a missing PythonOption
> perhaps? Unfortunately, I'm not very familiar with Python.
Actually, there is some historical weirdness with importing submodules under
mod_python. I think it has been fixed in newer versions, but the bugs are
still present in Debian/sarge (mod_python 3.1.3).
To try working around these import problems, nav does some rather odd
importing of modules from a lower point in the package hierarchy. The nav
module itself imports the nav.auth module into its own namespace (as 'auth').
Although nav.web.auth (the one you've patched above) doesn't explicitly
import nav.auth, it imports nav, which has the symbol 'auth' in its namespace.
That's why this (normally) works.
So why it suddenly doesn't work at your end I can't be sure of, because there
have been no changes to this code that I'm aware of. A situation where it
might fail, though, is if the nav module failed to import the nav.auth module
for some reason.
I'm going to take a closer look at this import circus when Debian/etch is
released as the next stable version, but your patch might solve the problem at
hand, as long as it doesn't break anything for anyone else (thanks!).