[mod_python] Subinterpreters and index.py

Daniel J. Popowich dpopowich at mtrsd.k12.ma.us
Thu Jul 1 13:47:17 EDT 2004

Gregory (Grisha) Trubetskoy writes:
> On Thu, 1 Jul 2004, Daniel J. Popowich wrote:
> >> Well, it turns out it's a FAQ, listed here :
> >>
> >> http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.016.htp
> >
> > This problem does NOT exist for Mod_python Servlets.
> I'd just like to point out that this is not a 'problem'. The 'problem' is 
> that some people do not understand how Python and mod_python work, but 
> that's about the extent of it :-)

True enough.  But how python manages module and package namespaces is
a relatively gnarly issue(*) which is only complicated by running
python inside apache via mod_python.  Mod_python, to the uninitiated,
gives the illusion that whole directory hierarchies are packages and
that sys.path is magically managed to be whatever you intend.
Realities like those posted above are quite startling, at first, and
perceived as "problems" or "known features."  :-)

This is one reason why I coded the servlet handler caching as I did.



(*) relative to the ease of programming the rest of the language.
I've always found it ironic that for such an intuitive language to
learn, that managing packages and modules is such a pain.  Granted,
package support was added late to the language (1.5), but decent
documentation is still lacking.  The standard documentation discussing
packages has had the following disclaimer for YEARS:

   [XXX Can't be bothered to spell this out right now; see the URL
   http://www.python.org/doc/essays/packages.html for more details,
   also about how the module search works from inside a package.]

And the document it points to is ancient.  This only compounds these
"problems".  Just look at how many posts to this discussion list are
import related.

More information about the Mod_python mailing list