[mod_python] Module getting imported twice?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Mon May 24 14:18:45 EDT 2004



On Mon, 24 May 2004, Sean Reifschneider wrote:

> On Mon, May 24, 2004 at 10:46:29AM -0400, Gregory (Grisha) Trubetskoy wrote:
> >I couldn't quite figure this out - do you actually have more than one
> >jotwebutils.py in the sys.path?
>
> No.  As you can see from this:
>
> >>    <module 'jotweb.jotwebutils' from
> >>       '/usr/lib/python2.2/site-packages/jotweb/jotwebutils.py'>
> >>    <module
> >>       '/var/www/jotweb/www.tummy.jotweb.jotwebutils' from
> >>       '/usr/lib/python2.2/site-packages/jotweb/jotwebutils.py'>

This second one does look odd. But it's very hard to tell what is going on
here. First, I'd try Python 2.3 (and mp 3.1) and see if it behaves
differently.

Also, the value of module I think depends on how it is imported, i.e.
using 'from' vs 'import' vs the imp module might give you different
results, and perhaps there is a bug in Python when a module is imported by
more than way it corrupts the value of module...

Grisha


More information about the Mod_python mailing list